- Thread starter
- #201
Again just a note so it is not forgotten:
There has somone apparently already written a DDLBuilder class for SQLite - which is the most part of making SQLite compatible with EF4 (i.e. with SlimTV Native):
https://github.com/jcwmoore/athena/blob/master/Athena.SQLite.Entity/DdlBuilder.cs
The code is apparently based on the MS sample provider and that guy ran into the same problem as I did with my first try: SQLite does not support "ALTER TABLE ADD CONSTRAINT ...". You have to specify the constraints already in the "CREATE TABLE" statement. It's not possible to later add them. The solution there is to "fake" the constraints with triggers. OK, that might work (didn't try, yet), but somehow I don't like the idea of faking a functionality, which is actually there but needs to applied just by another syntax.
Nevertheless, this helps a lot and shows that my idea is not completely out of scope...
There has somone apparently already written a DDLBuilder class for SQLite - which is the most part of making SQLite compatible with EF4 (i.e. with SlimTV Native):
https://github.com/jcwmoore/athena/blob/master/Athena.SQLite.Entity/DdlBuilder.cs
The code is apparently based on the MS sample provider and that guy ran into the same problem as I did with my first try: SQLite does not support "ALTER TABLE ADD CONSTRAINT ...". You have to specify the constraints already in the "CREATE TABLE" statement. It's not possible to later add them. The solution there is to "fake" the constraints with triggers. OK, that might work (didn't try, yet), but somehow I don't like the idea of faking a functionality, which is actually there but needs to applied just by another syntax.
Nevertheless, this helps a lot and shows that my idea is not completely out of scope...