-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Open
Milestone
Description
Microsoft.Data.Sqlite has support for this: https://docs.microsoft.com/en-us/dotnet/standard/data/sqlite/types#alternative-types : Using REAL (JulianDay) instead of TEXT (ISO8601 formatted string).
But how do I enable this for EFcore for newly written data? (Reading existing databases already seems to work fine)
I tried
builder.Property("name").HasColumnType("REAL")
and
builder.Property("name").HasConversion<double>() or .HasConversion<float>()
I tried both each other exclusive and in combination:
HasColumnTypeonly reflects increate tablebut uses still TEXT for new data (used SQLite'stypeof()function to verify)HasConvertionjust fails on creating initial SQL
In contrast in order to use binary blob GUIDs (instead of strings) just works by using .HasColumnType("BLOB").HasConversion<byte[]>().
I fear I have to write a converter which calculates the JulianDay in advance?
[EF 5.0.5 on netcore3.1 and net5]