Re: Using in CoreData an SQLite database created in a non CoreData app
Re: Using in CoreData an SQLite database created in a non CoreData app
- Subject: Re: Using in CoreData an SQLite database created in a non CoreData app
- From: David Emme <email@hidden>
- Date: Mon, 7 Aug 2006 08:02:49 -0700
On Aug 7, 2006, at 5:05 AM, Alexander Lamb wrote:
I managed to export some data (Access) to an SQLite3 database on
Windows (after setting the legacy_file_format PRAGMA for MacOSX
compatibility) through an ODBC adaptor.
Now I have this SQLite3 database on MacOSX I would like to use as a
data store/source for a CoreData application.
It doesn't work because:
1) The CoreData metadata is missing
2) The table names don't match.
[...]
How can I map the tables, since CoreData seems to create
Znameoftable instead of nameoftable.
I'm definitely no expert, but I've been doing some CoreData work
lately, and looking at the SQLite tables that are generated. Some of
the results have been surprising. It's definitely more than just
prepending a "Z" onto table names. For example, in one case my data
model had two related entities and I expected to see an SQLite table
for each. Instead, the records were merged into a single table!
Bottom line, I think the safest (and possibly the best) way for you
to proceed is to write a simple importer to read your SQLite tables
(check out QuickLite) and write the results into CoreData entities.
(Or else just forget about CoreData and use QuickLite in your app.)
Otherwise, unless your tables are arranged, and tables and fields
named, exactly the way CoreData expects (demonstrably *not*
necessarily obvious), then, as we say, "you will surely loose".
Good Luck!
-Dave
--
Irreverence is the champion of liberty, and its only sure defense.
-- Mark Twain
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden