Wednesday, March 14, 2012

ipad - SQLite database on PhoneGap / iOS - More than 5mb possible - Stack Overflow

ipad - SQLite database on PhoneGap / iOS - More than 5mb possible - Stack Overflow: "You can use a native SQLite DB (same as WebSQL) with a phonegap plugin, and you will not have any limitation. In iOS5.1, WebSQL is considered temporary data that can be deleted at any time...That plugin save the database in the Document folder, that mean that the DB is not deleted and is saved by iCloud.

Here is the Native SQLite phonegap plugin : https://github.com/davibe/Phonegap-SQLitePlugin Regarding this plugin, there are some differences between the WebSQL API, here is an adaptor: https://gist.github.com/2009518

You should also migrate the old WebSQL db file (stored in Library/WebKit or Caches directory) to the Document folder. Here is a code to do that : https://gist.github.com/2009491

And if the data are important, you should save it to a server. I wrote a small lib to synchronize the SQlite DB to a server : https://github.com/orbitaloop/WebSqlSync"

'via Blog this'