Has anyone developed a singleton for accessing SQLite db? I know that there are other options like Core Data but, in my case, I need SQLite. I have looked at Apple provided singleton creation code (here) but the thing is SQLite database “stuff” is not an object, it is “typedef struct sqlite3”. So currently, I’m doubting how should I adapt this code for being singleton. Any suggestions, please 🙂
UPDATE: I have looked at FMDB framework for SQLite that does all stuff but it doesn’t implement singleton. I mean, access methods are instance not class methods. If I need to call the SQL statements from different my code places I need to pass a pointer around instead of calling some shared instance class method 🙁 So, the question remains open.
I think you should use FMDB, it is one of good wrapper libraries around for SQLite3.
See details about FMDB here http://www.ioslib.com/library/data/fmdb/