Skip to content

Commit

Permalink
Merge pull request #143 from otype/cordovasupport
Browse files Browse the repository at this point in the history
added description in README on how to use the Cordova support
  • Loading branch information
zefhemel committed Mar 21, 2014
2 parents 5d164af + 0f60836 commit d77e9d1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,23 @@ in your database name (it will create it if it does not already exist,
the third is a description for you database, the last argument is the
maximum size of your database in bytes (5MB in this example).

## Setting up for Cordova with SQLitePlugin/WebSQL

Use following if you want to use `persistencejs` in a [Cordova](https://cordova.apache.org/) mobile app and you plan to use the [Cordova SQLitePlugin](https://github.com/brodysoft/Cordova-SQLitePlugin):

persistence.store.cordovasql.config(
persistence,
'yourdbname',
'0.0.1', // DB version
'My database', // DB display name
5 * 1024 * 1024, // DB size
0 // SQLitePlugin Background processing disabled
);

For more information on the SQLitePlugin background processing please refer to the [SQLitePlugin](https://github.com/brodysoft/Cordova-SQLitePlugin) readme.

The Cordova support in `persistencejs` will try to work with the [SQLitePlugin](https://github.com/brodysoft/Cordova-SQLitePlugin) if it is loaded; if not it will automatically fall back to [WebSQL](http://docs.phonegap.com/en/edge/cordova_storage_storage.md.html#Storage).

The in-memory store
---------------------------------------

Expand Down

0 comments on commit d77e9d1

Please sign in to comment.