Question

I'm currently developing an hybrid app using the Salesforce-Mobile-SDK. In order to fulfill some offline requirements which are part of the project I need to access some sort of database on the device and my first pick is SQLite.

Is there any PhoneGap 2.3.0 compatible plugin to open and perform CRUD operations on a SQLite database?

I've already googled a lot this afternoon and i've found somw interesting plugins but they refer to other PhoneGap versions and i'm afraid i'm constrained to v 2.3.0.

Thank you. M.

Was it helpful?

Solution

You shouldn't need a plugin for this as support for webSQL(sqlite) is included in PhoneGap 2.3.0.

You can find the documentation here

Example:

var db = window.openDatabase('appdb','1.0','AppDB',5000000);

db.transaction(function(tx){
   tx.executeSql('CREATE TABLE IF NOT EXISTS test_table (itemid INTEGER PRIMARY KEY, otherField, someField)');
}, errorCallback, successCallback));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top