I’m trying to create an sqlite database that will live on the file system so I can get it across sessions, but I can’t figure out how.
Doing something like:
local db = sqlite3.open(‘httt.sqlite3’);
works fine in the emulator but doesn’t work on the device (tested on iPod Touch). I tried using stuff like createpath but those didn’t seem to work. The documentation only shows how to open/create an in memory database.
Also, just to clarify, when I do something like this:
local path = system.pathForFile( “httt.sqlite3”, system.ResourceDirectory )
local db = sqlite3.open(path);
I get the following error in the simulator terminal:
Runtime error
/Projects/myprojectname/main.lua:54: bad argument #1 to ‘open’ (string expected, got nil)
stack traceback:
[C]: ?
[C]: in function ‘open’
[import]uid: 6678 topic_id: 1274 reply_id: 3429[/import]
Hmm, thanks, I could have sworn I tried that, but I’ll give it another try a little later! I’ll let you know what happens. [import]uid: 6678 topic_id: 1274 reply_id: 3451[/import]