SQLite - Can't insert null into TIMESTAMP column
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the integration-test insert with the shown IsRequired, IsRowVersion, and IsConcurrencyToken configuration using Microsoft.Data.Sqlite 3.1.3 on netcoreapp3.1. Inspect whether the generated insert includes TxTimestamp and compare the SQLite behavior with the SQL Server-generated model. Done means identifying why the supplied byte value is not inserted, or documenting the provider limitation and available model override.
Written by the indexing model from the issue text.
Description
Using in memory EF Core SQLite for integration tests. When creating an entity with the following column definition:
entity.Property(e => e.TxTimestamp)
.IsRequired()
.IsRowVersion()
.IsConcurrencyToken();
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
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 134
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/efcore
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
customer-reported
Difficulty 5/5 Over a week Newbie friendliness 38/100
-
area-cosmos area-vector-search
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
area-cosmos
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
area-tools needs-design
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100