Closed MichaelCharles closed 1 year ago
Is this a dialect 1 DB? quoted identifiers are only supported in Dialect 3. Make sure you are setting your connection string to include Dialect=1 when connecting to a dialect 1 DB. That is an expected error message when using quoted identifiers with a dialect 1 DB. I made some updates to the latest primary ADO.NET driver around scaling back when asking for 3, but the DB is 1, but I did not test scaling back in the EFCore code (actually I did test scaffolding this way, but nothing else). I can't think of a reason why it wouldn't work, but try adding Dialect=1 to your connection string if this is a dialect 1 DB.
The dialect is set to 1 it seems
SQL> SHOW SQL DIALECT;
Client SQL dialect is set to: 1 and database SQL dialect is: 1
SQL>
I tried setting the collection string to include ";Dialect=1" but it seems to be having no effect on the way the SQL is generated. Just in case I tried setting the dialect to 5, and I got an error saying that it must be 1, 2, or 3, so I am setting it in the right place/way.
Is there anything else that I can do to get it to use dialect 1? Other than for setting the connection string, is there any kind of necessary configuration?
This is fixed in the 7.13.7 release which is now also in NuGet. To work with a dialect 1 DB you need to tell the EFCore code that it is dialect 1. Unfortunately, where the quote identifying is done there is no access to the ConnectionString, Connection, or DBContext. So before using the EFCore code with a Dialect 1 DB you need to make this call to set a static variable in the SqlGeneratorHelper.
InterBaseSql.EntityFrameworkCore.InterBase.Storage.Internal.IBSqlGenerationHelper.Dialect = 1;
Now columns, tables, aliases, store procedure names, etc will not be double-quoted in dialect 1.
Interbase version
.NET Core 6 ASP.NET Project
Entity Framework/Interbase related packages:
I have Interbase 2022 installed on my local machine.
I'm attempting to use Entity Framework to connect to and retrieve data from an Interbase DB.
When I trying to do something like
await db.Contacts.ToListAsync()
, the following error is throne,If I setup Entity Framework to log the SQL being executed, this is the result
I attempted to connect to the database using
isql
and tried a query using a similar syntax, and it threw the same error.If I remove the quotation marks and run
SELECT k.KANK_CD FROM KANK AS k;
it works as expected.I'm not very experienced with Interbase, but it seems as though perhaps using quotations like that isn't supported? I think it is getting parsed as being a string, as if I do
SELECT "FOOBAR" FROM KANK
it outputs a bunch of "FOOBAR" for each row.Is there some configuration step for Entity Framework that is necessary in order to make it work correctly?