Permalink
Browse files

Updated readme to reflect current API

  • Loading branch information...
1 parent d731f4d commit ab36d9868cf0a23a20f2e080b29441b566e259e1 @aaronpowell committed May 15, 2012
Showing with 182 additions and 165 deletions.
  1. +22 −19 README.md
  2. +160 −146 project.sublime-workspace
View
@@ -13,38 +13,41 @@ Add a reference to db.js in your application before you want to use IndexedDB:
Once you have the script included you can then open connections to each different database within your application:
var server;
- db.open( 'my-db' , 1 , {
- people: {
- key: {
- keyPath: 'id',
- autoIncrement: true
- }
- }
- }, function ( s ) {
- server = s;
- //connection is open and ready for use
- });
+ db.open({
+ server: 'my-app',
+ version: 1,
+ done: function ( s ) {
+ server = s;
+ }, {
+ people: {
+ key: { keyPath: 'id' , autoIncrement: true }
+ }
+ }
+ });
A connection is intended to be persisted and you can perform multiple operations while it's kept open. Check out the `/tests/public/spec` folder for more examples.
## Adding items
- server.add( 'people' , {
- firstName: 'Aaron',
- lastName: 'Powell'
+ server.people.add( {
+ firstName: 'Aaron',
+ lastName: 'Powell'
} , function ( item ) {
- //item stored
+ //item stored
});
## Removing
-TODO
+ server.people.remove( 1 , function ( item ) {
+ //item stored
+ });
## Querying
-TODO
-
-# License
+ server.people.query( 'firstName' , 'Aaron' )
+ .execute( function ( results ) {
+ //do something with the results
+ });
The MIT License
Oops, something went wrong.

0 comments on commit ab36d98

Please sign in to comment.