in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

ProviderIncompatibleException

Last post 10-25-2010 10:32 AM by macaulay. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-06-2010 3:45 PM

    ProviderIncompatibleException

    When I found out that there was an EF provider for SQLite, I was really excited because one of the major barriers to using EF is its utter lack of testability without building a framework around it (this, to me defeats the point of using EF to begin with). Unfortunately, there are two extremely important features that aren't enabled: checking to see if the database exists and creating the database. One of the main draws of using SQLite with EF is as an in-memory database on which you can run your unit tests. Obviously, you cannot do this without calling the CreateDatabase function. Is there any intention on implementing these functions?

     

    Thanks...

    Filed under:
  • 06-16-2010 1:41 PM In reply to

    Re: ProviderIncompatibleException

     I appreciate SQLite provider for EF, and have the same idea for realize unit tests.

    But I have the same problem. I can create a in memory (perfect for test) but i don't know create the tables of entity model.

    The CreateDatabase method of ObjectContext fail with a ProviderIncompatibleException.

    Will this feature be soon implemented ? Or another idea to create test database ?

  • 10-25-2010 10:32 AM In reply to

    Re: ProviderIncompatibleException

    I discovered (to my dismay :() that System.Data.SQLite doesn't implement the CreateDatabase() method.

    The obvious workaround (of copying and renaming a created but empty SQLite fileto the path of the desired new database file) is not an acceptable solution for me: I used the Entity Framework to importan existing SQLite database, but I have made several changes to the design, and I foresee making more changes in the future, and I don't want to have to manually create a file to match theEF model that I am using as the"master copy" of what the database will look like.

    So, I am currently implementing my own version of CreateDatabase() that will use reflection to pull theObjectSet[ members of my ObjectContext and make each one of them into a table of the same name, and then use reflection on the GenericArgument of the ObjectSet, to get the EdmScalarPropertyAttributes to determine nullability and entitykey settings.

    I have seen some mention via google of people parsing the .edmx file at runtime, but I think I'll skip that for now.

    Before I get too far, does anyone have any news on a forthcoming CreateDatabase() implementation, or perhaps an example of how they solved this problem?


Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems