Skip to content

Commit

Permalink
Updated readme to reflect current API
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronpowell committed May 15, 2012
1 parent d731f4d commit ab36d98
Show file tree
Hide file tree
Showing 2 changed files with 182 additions and 165 deletions.
41 changes: 22 additions & 19 deletions README.md
Expand Up @@ -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: Once you have the script included you can then open connections to each different database within your application:


var server; var server;
db.open( 'my-db' , 1 , { db.open({
people: { server: 'my-app',
key: { version: 1,
keyPath: 'id', done: function ( s ) {
autoIncrement: true server = s;
} }, {
} people: {
}, function ( s ) { key: { keyPath: 'id' , autoIncrement: true }
server = s; }
//connection is open and ready for use }
}); });


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. 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 ## Adding items


server.add( 'people' , { server.people.add( {
firstName: 'Aaron', firstName: 'Aaron',
lastName: 'Powell' lastName: 'Powell'
} , function ( item ) { } , function ( item ) {
//item stored //item stored
}); });


## Removing ## Removing


TODO server.people.remove( 1 , function ( item ) {
//item stored
});


## Querying ## Querying


TODO server.people.query( 'firstName' , 'Aaron' )

.execute( function ( results ) {
# License //do something with the results
});


The MIT License The MIT License


Expand Down

0 comments on commit ab36d98

Please sign in to comment.