tags:

views:

613

answers:

2

Is there any common sqlite3 connection class available for working with the iPhone SDK. I realize that it is quite easy to connect and run queries everytime, but to save up more time it would be a real help if we could use a class to handle all the sql directly.

I would imagine something which returns a NSMutableArray if you pass a query to it.

Is there something available?

+1  A: 

We use the FMDB wrappers by Flying Meat and Gus Mueller. They do a reasonably good job of wrapping the C API of sqlite3 with Cocoa and returning first-class Cocoa types. You don't get back an NSMutableArray from a query--you get an FMResultSet, similar in spirit to a JDBC ResultSet (if memory serves). It's also MIT licensed, if that matters.

drewh
+2  A: 

Also take a look at SQLitePersistentObjects, which I use. The big advantage is that I for now don't have to worry about schemas and such. However, SQLitePO doesn't seem to be able to store objects into alternate tables, AFAIK. Otherwise it seems to work fine.

Alfons