Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brodycj/cordova-sqlite-community-lawnchair-adapter
COMMUNITY SUPPORTED
https://github.com/brodycj/cordova-sqlite-community-lawnchair-adapter
Last synced: about 2 months ago
JSON representation
COMMUNITY SUPPORTED
- Host: GitHub
- URL: https://github.com/brodycj/cordova-sqlite-community-lawnchair-adapter
- Owner: brodycj
- Created: 2016-12-20T11:34:34.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-20T11:34:49.000Z (about 8 years ago)
- Last Synced: 2024-07-31T00:17:18.565Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cordova sqlite lawnchair adapter
Extracted from work in the following projects:
- [brianleroux / lawnchair](https://github.com/brianleroux/lawnchair)
- [davibe / Phonegap-SQLitePlugin](https://github.com/davibe/Phonegap-SQLitePlugin)
- [litehelpers / Cordova-sqlite-storage](https://github.com/litehelpers/Cordova-sqlite-storage)**LICENSE:** MIT
**STATUS:** Community maintained
## Common adapter
Please look at the `Lawnchair-adapter` tree that contains a common adapter, which should also work with the Android version, along with a test-www directory.
### Included files
Include the following Javascript files in your HTML:
- `cordova.js` (don't forget!)
- `lawnchair.js` (you provide)
- `SQLitePlugin.js` (in case of Cordova pre-3.0)
- `Lawnchair-sqlitePlugin.js` (must come after `SQLitePlugin.js` in case of Cordova pre-3.0)### Lawnchair Sample
The `name` option determines the sqlite database filename, *with no extension automatically added*. Optionally, you can change the db filename using the `db` option.
In this example, you would be using/creating a database with filename `kvstore`:
```Javascript
kvstore = new Lawnchair({name: "kvstore"}, function() {
// do stuff
);
```Using the `db` option you can specify the filename with the desired extension and be able to create multiple stores in the same database file. (There will be one table per store.)
```Javascript
recipes = new Lawnchair({db: "cookbook", name: "recipes", ...}, myCallback());
ingredients = new Lawnchair({db: "cookbook", name: "ingredients", ...}, myCallback());
```**KNOWN ISSUE:** Not all db options are supported by the Lawnchair adapter. The workaround is to first open the database file using `sqlitePlugin.openDatabase()`.