How do I check a sqlite database exists?

Does anyone know away of making sure data has been written to a database?

For example I might run something like…

[lua]local insertQuery = [[UPDATE listsItems SET status=‘false’ WHERE id =’]]…sqlID…[[’]]; db:exec( insertQuery ); [/lua]
And then run some code thats directely effected my that update to the database.

Sometimes Im finding that data has not been written yet to the database yet.

Any “updatecomplete” listeners or anything for sql?

Thanks [import]uid: 102413 topic_id: 26102 reply_id: 116576[/import]

Just a tip:

 --Open cart.sqlite, if the file doesn't exist it will be created   
 local path = system.pathForFile("cart.sqlite", system.DocumentsDirectory)  
 local cartDb = sqlite3.open( path )  

sqlite3.open() will create the file for you if it does not exist.

Regarding your other question:

“The function (db:exec) returns sqlite3.OK on success or else a numerical error code (see Numerical error and result codes).”

(Source: http://lua.sqlite.org/index.cgi/doc/tip/doc/lsqlite3.wiki#db_exec )
Regards! [import]uid: 113596 topic_id: 26102 reply_id: 116585[/import]