javascript - Pre-populate iPhone Safari SQLite DB -


I am working with a PhoneGapp app which uses Safari Local Storage (SQL DB) via Javascript:

On the first load, app database creates tables, and populates data through a series of INSERT statements.

If the user closes the app during this processing, then my app database is left in an inconsistent state.

What I like to do, is to deploy SQLite DB as part of my iTunes app packaging so that nothing in the app cold start should come. However, I'm not sure that this is possible - all the Google hits for this topic are what I can find, which are talking about the SQLite rendered core-data, which we are not using it. .

If this is not possible, can I wrap the whole thing in a transaction and when the app is restarted then can it try again?

On not accepting this, I think I have a boolean column "is_app_db_loaded?" And after processing all my insertion it set it to right. But it's really gross ...

Thoughts? Thanks!

I think that can work for you. Which includes pre-creation of the table, and copying it when the app starts.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -