Re: Embedding a database
Re: Embedding a database
- Subject: Re: Embedding a database
- From: Jerry Krinock <email@hidden>
- Date: Sat, 10 Jun 2006 20:11:05 -0700
- Thread-topic: Embedding a database
on 06/06/10 19:11, Keary Suska at email@hidden wrote:
> SQLite is likely a good API.
Yes, I've read that some other SQLs have blob size limited to 8K bytes, not
good when you're trying to store arbitrary Cocoa objects; also SQLite is
public domain. I presume Apple put a lot of thought into it when they used
it for CoreData. Pretty obvious choice.
> That's all there is to it. You may be able to find Cocoa classes that
> will provide an easier-to-use layer on the API, or worst case have to do
Someone might want to recommend one of these Cocoa classes I keep hearing
about. I found one and it gave a bunch of compile errors, so I ended up
writing my own.
> some C (e.g. working with C-strings, pointers, and memory buffers). Moving
> between primitive C types and Cocoa objects is fairly trivial, though.
Putting strings and numbers into sqlite was trivial, but when you decide to
serialize all your objects to NSData and store them as blobs, you have to
to use transactions (begin, prepare, bind, step, etc.) This was "fun", but
no, not trivial.
Another tip: The SQLite Apple packages with Tiger is version 3.1.3, March
2005, and it's missing quite a few basic features that will bite you about
once a day. So, I compiled the latest version and am packaging that as a
static library in my app. Needed it for Panther anyhow. I am losing the
patches which Apple did to improve accessing databases over a network, but
if your database file is local, that doesn't matter.
_______________________________________________
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