EntityFramework-Reverse-POCO-Code-First-Generator
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard
Support SQLite database
Hi Simon
How is the support for sqlite going? Is this an option now or in the future?
You should be able to use Sqlite now, even though its not yet officially supported.
See case #505 about removing .HasColumnType.
Thanks for that Simon
Is this the only necessary adjustment? How about mappings on decimals - does this need any special treatment?
https://docs.microsoft.com/en-us/ef/core/providers/sqlite/limitations
@statler Thanks for that link.
Note to self, SQLite does not support the following types:
- DateTimeOffset
- Decimal
- TimeSpan
- UInt64
Instead of DateTimeOffset, Microsoft recommend using DateTime values. When handling multiple time zones, convert the values to UTC before saving and then converting back to the appropriate time zone.
The Decimal type provides a high level of precision. If you don't need that level of precision, however, use a double instead. You can use a value converter to continue using decimal in your classes.
modelBuilder.Entity<MyEntity>()
.Property(e => e.DecimalProperty)
.HasConversion<double>();
Simon
Just revisiting this again - 2 years on - official support? Your 'note to self' above - is that included in the templating?
Also, do you have a step-by-step for using it with Sqlite - what are the appropriate settings?
Apologies @statler this fell off my radar. I'll get it added asap (today?) as I've popped it to the top of my list.
It's taking longer than expected... I'll keep it as current and get it resolved as soon as I can.
Thanks for your updates here Simon. When do you think you will be ready for it to be used? I will be able to provide real life feedback on a pretty complex db if that will help
Thanks, @statler. Perhaps 2 weeks? Still got to finalise the SQL to reverse engineer the Db fully. I also need to convert one of my horrible SQL Server (if you can reverse engineer this you can reverse engineer any database) into SQLite and test with that.
OK thanks. Any advance on that in whatever state would be appreciated. It's pretty time sensitive for me atm.
Hi @statler Can you give this EF.Reverse.POCO.v3.ttinclude a try in your project. Let me know how it goes.
This has been released in v3.8.2. Any problems, please let me know.