dimanche 22 février 2015

Store data from database to local using entity framework 6

I have data stored in a MySQL database and I'm accessing it through entity framework 6. What I want to do is to extract the data and store it in a server-independent manner, so that I can use this data in the future for bootstraping of a larger database (where the data from MySQL is only a small portion of). The target database will not be MySQL.


The MySQL data was there before, so I used Database First. For the new database I use Code First. The MySQL data also needs some clean-ups, what is done in code. So the workflow is:



  1. Read data from MySQL with Entity Framework database first

  2. Optimize/enhance/correct it in code

  3. Store in another database using code first


So my first thought was using SQLite, but sadly, Code First is not supported.


Using some other format (i.e. XML/DataSets/CSV) to store the data would require me to reimplement the import code.


Right now I didn't find another embedded database with Entity Framework support. As Entity Framework is meant for relational databases, I would say that Redis (or other NoSQL dbs) won't do the trick.


I also thought if "converting" H2 using IKVM.NET and then using H2 as SQLite replacement would be an option -- but there's the risk that this might fail due to some internal dependency not supported by IKVM.NET.


So I would be glad to get answers to the following questions:



  1. Would the H2 way work? Is there even a stable/working ADO.NET provider?

  2. I wouldn't care much about the local storage format (could also be JSON etc.) -- is there anything not-SQL, but providing Enitity Framework support?

  3. Did I miss something? Is there a way I just didn't see yet?


Aucun commentaire:

Enregistrer un commentaire