Open Banchio opened 1 year ago
I'm still trying to identify a cross platform solution, but the underlying cause is from:
Sales.Customers due to: DataReader.GetFieldType(24) returned null.
and since GetFieldType is zero index, it seems to be pointing to the column: DeliveryLocation of sql type Geography
On Windows there are a number of stackoverflow/github discussions which allude to using Microsoft.SqlServer.Types https://www.nuget.org/packages/Microsoft.SqlServer.Types/#readme-body-tab to allow proper handling of SQL spatial types like Geography.
Thanks @seantleonard , removing that field from my sample database worked. I've renamed the issue to keep track, thanks
Need to test out preview version of sqlclient to see behavior difference, if any. https://github.com/dotnet/SqlClient/releases/tag/v5.2.0-preview1 with release note:
Added Microsoft.SqlServer.Types to verify support for SqlHierarchyId and Spatial for .NET Core. https://github.com/dotnet/SqlClient/pull/1848
Will also need to see how/if SQL server returns the SqlDataType of the spatial/geography types , and add compatibility flag in https://github.com/Azure/data-api-builder/pull/1568/files/9e914ab71352cbd4b2d380f0bfba35fe4ed30615#diff-d76ea4e7b6d1e701ff517cfb7fc205c60de6c749348bb126f83e69dc6bbfcf4a
What happened?
I have tried to use DAB to expose Sales.Customer table from World Wide Importers database. DAB fails to start with the exception reported below. If I try to publish a non SystemVersioned Table (Sales.Orders, Sales.Invoices, etc) it works perfectly so I think this is due to the fact that Sales.Customers is a System-Versioned table in SQL.
I was able to repro the error in Visual Studio and it seems that exception is raised from the FillSchema method of the DbDataAdapter in the System.Data.Common but not sure about the reason.
Thanks
Version
0.5.34
What database are you using?
Azure SQL
What hosting model are you using?
Local (including CLI)
Which API approach are you accessing DAB through?
REST, GraphQL
Relevant log output
Code of Conduct