fsprojects / SQLProvider

A general F# SQL database erasing type provider, supporting LINQ queries, schema exploration, individuals, CRUD operations and much more besides.
https://fsprojects.github.io/SQLProvider
Other
564 stars 144 forks source link

Incorrect FROM statement is produced when a table name contains periods #793

Open jasonmcboyd opened 1 year ago

jasonmcboyd commented 1 year ago

Describe the bug

Using SQLProvider 1.3.8

Given a SQL table named A.B.C

This f# code: for t in ctx.Dbo.ABC

Produces this FROM statement when querying SQL Server: FROM [dbo.A.B].[C] instead of FROM [dbo].[A.B.C]

To Reproduce See above

Expected behavior I expect the correct FROM statement to be generated.

Thorium commented 1 year ago

The schema could have commas too... but would someone ever have a situation where they'd have [a.b].[c] and [a].[b.c] in the same database...

jasonmcboyd commented 1 year ago

I am not sure I understand. This is not a matter of the schema having periods or commas; the schema in question is [dbo]. The wrong query is being generated. It is querying table [C] in schema [dbo.A.B] neither that schema nor that table exist in the database. It should be querying table [A.B.C] in schema [dbo].