-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log a warning when "rowid" is a column on the table #23918
Comments
I'm not sure we can fix this. SQLite lets you completely hide access to the internal rowid value if you create a table that has a
|
Personally I'm fine with considering this just a minor inconvenience, i have a workaround, but maybe log a warning when the name rowid is used with the SQLite provider, so people can know to look for a workaround? This took me quite a while to actually identify originally. |
Just realized that #24835 would mitigate this |
Not needed after PR #27573 |
Oh cool, didn't even mean to fix this... |
Include your code
I'm currently working on migrating some old code to dotnet core. As part of that we have to work with an existing database until all the code can be changed (Which is probably still several years away). In an attempt to improve the code quality i'm trying to add some unit tests, however inserts into the table is failing. That code has this table:
Though in essense this table is enough to cause issues:
When we insert values we often insert
rowid = null
. like this (Generated by entity framework):The problem then comes from the last select, which is now querrying on the wrong column. So EF doesn't believe it actually inserted anything. A "solution" would be to use
_rowid_
, (https://sqlite.org/lang_createtable.html#rowid), which is believe would have less chance of conflicting, and would result in the same.Include stack traces
Include provider and version information
EF Core version: 5.0.0
Database provider: Microsoft.EntityFrameworkCore.Sqlite
Target framework: .net 5.0
Operating system: Windows 10
IDE: JetBrains Rider 2020.3.2
Workaround
For now i have added the following workaround so i can continue to write tests, even if the code doesn't mock the full database exactly anymore:
The text was updated successfully, but these errors were encountered: