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
Original file line number Diff line number Diff line change
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:

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

Expand Down
Loading

0 comments on commit ab36d98

Please sign in to comment.