Ios – Core Data data schema from existing SQLite database

core-dataiossqlite

Is it possible to generate a .xcdatamodel (CoreData data model) from an existing SQLite database file?

I've developed a SQLite database and written a Java API against it. Now, I need to write an equivalent iOS API to the same database (file). I'd prefer not to create the data schema by hand in xCode. I just want to generate the .xcdatamodel, and use xCode to generate the entity classes that I'll code against.

Is it possible?

Best Answer

See How do I use my existing SQLite database with Core Data? and Efficiently Importing Data. I understand that you're not asking specifically about using the entire database but just creating the model, but you have to understand that there's not a 1-1 relationship between an existing SQLite database and what Core Data wants to store.

Related Topic