We ended up using the PhoneGap SQLite plugin, here's why:
We started off using a plain old Web SQL Database in our PhoneGap app, but ran into the following limitations:
- Size of database is limited to 5MB (the user can be prompted to allow more, but we didn't want such prompts in our app)
- Pre-populating the database via javascript adds to initial app load time
We initially worked around this issue by copying a pre-populated sqlite3 database to a special directory where it would be picked up by WebKit (e.g. as described here)
However, in our latest attempt to submit the app, we were told the app violated iOS Data Storage Guidelines, presumably because it was copying the database file to a non-standard location.
So we went with using the PhoneGap SQLite plugin instead: This allowed us to include a large pre-populated sqlite3 database in our app and access it from javascript via the plugin. Unfortunately, the plugin doesn't provide exactly the same javascript interface as the browser, but it's fairly close.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…