Adding db option to change the sqlite filename

This commit is contained in:
Vojto Rinik 2011-12-02 16:45:09 +01:00
parent 6badbe15e4
commit a6798cb042

View File

@ -86,12 +86,19 @@ Include the following js files in your html:
- pgsqlite_plugin.js
- lawnchair_pgsqlite_plugin_adapter.js (must come after pgsqlite_plugin.js)
The `name` option will determine the sqlite filename. In this example, you would be using/creating
the database at: *Documents/kvstore.sqlite3* (all db's in PGSQLitePlugin are in the Documents folder)
The `name` option will determine the sqlite filename. Optionally, you can change it using the `db` option.
In this example, you would be using/creating the database at: *Documents/kvstore.sqlite3* (all db's in PGSQLitePlugin are in the Documents folder)
kvstore = new Lawnchair { name: "kvstore", adapter: PGSQLitePlugin.lawnchair_adapter }, () ->
# do stuff
Using the `db` option you can create multiple stores in one sqlite file. (There will be one table per store.)
recipes = new Lawnchair {db: "cookbook", name: "recipes", ...}
ingredients = new Lawnchair {db: "cookbook", name: "ingredients", ...}
### Other notes from @Joenoon: