-
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
SQLite - Can't insert null into TIMESTAMP column #20475
Comments
Notes for team: In this case the property is configured for automatic concurrency with an expectation that this will work like it does in SQL Server. This is tracked by #2195. Within this, the insert of null happens because the SQLite provider doesn't support computed properties--tracked by #19682. Should we check for one or both of these patterns in the model validator?
/cc @bricelam |
My work around is:
to create a default value for the column. Certainly not ideal |
See also #12260 (comment) |
@bricelam I couldn't find an issue about comments/warnings in the generated code. |
Found it: #2461 |
This exact scenario was previously discussed in #7295 |
Putting this on the backlog to consider generating some form of inline warning. |
Use [ConcurrencyCheck] to Manual management ConcurrencyCheck Key。 |
Using in memory EF Core SQLite for integration tests. When creating an entity with the following column definition:
Setting with
TxTimestamp = new byte[8] { 0, 1, 2, 3, 4, 5, 6, 7 }
I get the following error:
Microsoft.Data.Sqlite.SqliteException : SQLite Error 19: 'NOT NULL constraint failed: [TableName].TxTimestamp'.
Any ideas? It is like SQLite isn't inserting the value. Perhaps because with real SQL Server it wouldn't be able to? This model is generated from a SQL Server database and we are using database first, so I can't just change the model builder definition. (unless there is an easy way to override the one generated form the scaffold).
Additional context
Microsoft.Data.Sqlite version: 3.1.3
Target framework: netcoreapp3.1
Operating system: Win 10
The text was updated successfully, but these errors were encountered: