Re: Sqlite and Core Data
Re: Sqlite and Core Data
- Subject: Re: Sqlite and Core Data
- From: Jens Alfke <email@hidden>
- Date: Fri, 16 Oct 2009 21:15:28 -0700
On Oct 16, 2009, at 7:43 PM, Thomas Hart wrote:
Can I use Core Data to access the sqlite database that I've created?
Are there any files I need to add, or code I need to write?
Not directly. Core Data does use SQLite to store data, but it uses
very specific conventions for names and relations, and it isn't
capable of working with any database or table that it didn't create
itself. It's not a generalized ORM, but an object persistence API that
just happens to use a SQL database as a backing store.
If I can't use Core Data to access sqlite, do I need to migrate the
data to be a persistent store, and are there tools to do that?
Yes; and not as far as I know. You'll need to write code that reads
data from your existing SQLite database, and then adds it to your
CoreData object model.
SQLite's raw C API isn't too hard to use, and there are a couple of
Cocoa libraries (like FMDB and QuickLite) that make working with it in
a Cocoa app easier.
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden