无法在 MacOS 上访问所有冒险作品表

Can't access all adventure works tables on MacOS

我在本地 docker 容器和 sql 服务器上都有冒险作品。当我尝试访问冒险作品时,我只有 3 个表。 在 windows 上有效。 我使用 DBeaver 和 DBvisualizer 进行连接。 Screen-shot

已解决:在新版本的 DBeaver 中已解决,这是来自 ms-sql 驱动程序的错误。但是在DBvisualizer中还是不行。

我注意到在 MacOS 上使用 jTDS 驱动程序不会列出 SQL 服务器数据库中的所有模式,所以我想这个问题也可能扩展到表。切换到 MS JDBC 驱动程序,看看是否能解决问题。

使用此 docker 命令:

sudo docker exec -it sql1 /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'myStrongP@ssw0rd' -Q "select table_schema,table_name,table_type from AdventureWorks2012.Information_Schema.Tables order by table_type, table_schema, table_name" | tr -s ' '

这些是我得到的 table 列表:

table_schema table_name table_type
-------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ----------
dbo AWBuildVersion BASE TABLE
dbo DatabaseLog BASE TABLE
dbo ErrorLog BASE TABLE
HumanResources Department BASE TABLE
HumanResources Employee BASE TABLE
HumanResources EmployeeDepartmentHistory BASE TABLE
HumanResources EmployeePayHistory BASE TABLE
HumanResources JobCandidate BASE TABLE
HumanResources Shift BASE TABLE
Person Address BASE TABLE
Person AddressType BASE TABLE
Person BusinessEntity BASE TABLE
Person BusinessEntityAddress BASE TABLE
Person BusinessEntityContact BASE TABLE
Person ContactType BASE TABLE
Person CountryRegion BASE TABLE
Person EmailAddress BASE TABLE
Person Password BASE TABLE
Person Person BASE TABLE
Person PersonPhone BASE TABLE
Person PhoneNumberType BASE TABLE
Person StateProvince BASE TABLE
Production BillOfMaterials BASE TABLE
Production Culture BASE TABLE
Production Document BASE TABLE
Production Illustration BASE TABLE
Production Location BASE TABLE
Production Product BASE TABLE
Production ProductCategory BASE TABLE
Production ProductCostHistory BASE TABLE
Production ProductDescription BASE TABLE
Production ProductDocument BASE TABLE
Production ProductInventory BASE TABLE
Production ProductListPriceHistory BASE TABLE
Production ProductModel BASE TABLE
Production ProductModelIllustration BASE TABLE
Production ProductModelProductDescriptionCulture BASE TABLE
Production ProductPhoto BASE TABLE
Production ProductProductPhoto BASE TABLE
Production ProductReview BASE TABLE
Production ProductSubcategory BASE TABLE
Production ScrapReason BASE TABLE
Production TransactionHistory BASE TABLE
Production TransactionHistoryArchive BASE TABLE
Production UnitMeasure BASE TABLE
Production WorkOrder BASE TABLE
Production WorkOrderRouting BASE TABLE
Purchasing ProductVendor BASE TABLE
Purchasing PurchaseOrderDetail BASE TABLE
Purchasing PurchaseOrderHeader BASE TABLE
Purchasing ShipMethod BASE TABLE
Purchasing Vendor BASE TABLE
Sales CountryRegionCurrency BASE TABLE
Sales CreditCard BASE TABLE
Sales Currency BASE TABLE
Sales CurrencyRate BASE TABLE
Sales Customer BASE TABLE
Sales PersonCreditCard BASE TABLE
Sales SalesOrderDetail BASE TABLE
Sales SalesOrderHeader BASE TABLE
Sales SalesOrderHeaderSalesReason BASE TABLE
Sales SalesPerson BASE TABLE
Sales SalesPersonQuotaHistory BASE TABLE
Sales SalesReason BASE TABLE
Sales SalesTaxRate BASE TABLE
Sales SalesTerritory BASE TABLE
Sales SalesTerritoryHistory BASE TABLE
Sales ShoppingCartItem BASE TABLE
Sales SpecialOffer BASE TABLE
Sales SpecialOfferProduct BASE TABLE
Sales Store BASE TABLE
HumanResources vEmployee VIEW 
HumanResources vEmployeeDepartment VIEW 
HumanResources vEmployeeDepartmentHistory VIEW 
HumanResources vJobCandidate VIEW 
HumanResources vJobCandidateEducation VIEW 
HumanResources vJobCandidateEmployment VIEW 
Person vAdditionalContactInfo VIEW 
Person vStateProvinceCountryRegion VIEW 
Production vProductAndDescription VIEW 
Production vProductModelCatalogDescription VIEW 
Production vProductModelInstructions VIEW 
Purchasing vVendorWithAddresses VIEW 
Purchasing vVendorWithContacts VIEW 
Sales vIndividualCustomer VIEW 
Sales vPersonDemographics VIEW 
Sales vSalesPerson VIEW 
Sales vSalesPersonSalesByFiscalYears VIEW 
Sales vStoreWithAddresses VIEW 
Sales vStoreWithContacts VIEW 
Sales vStoreWithDemographics VIEW

所有 table 都在 docker 容器中,在它们指定的模式下。

“我只需要大学冒险作品。我如何使用这些库” 我不明白你的意思。以上 docker 命令列出 tables 是使用它的一种方式。您也可以使用 sqlcmd shell 从 docker 容器中 运行 它。也许你应该更好地解释你想做什么。 FWIW 在 Mac 或 Linux 上我会简单地使用类似 postgreSQL 的东西。