Skip to content

Commit

Permalink
updated documentation, in order to show how to reate autoincrement pr…
Browse files Browse the repository at this point in the history
…imary keys (thanks @KarB)
  • Loading branch information
xavierlacot committed May 2, 2011
1 parent e53bdd2 commit 0ba1ca5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.markdown
Expand Up @@ -103,6 +103,18 @@ At the first launch of an application on a device, it is required to create the
joli.models.initialize();


Would you like the "id" to get autoincremented, just add the informations "PRIMARY KEY AUTOINCREMENT" to the column definition :

var city = new joli.model({
table: 'city',
columns: {
id: 'INTEGER PRIMARY KEY AUTOINCREMENT',
name: 'TEXT',
description: 'TEXT'
}
});


### Data insertion
Inserting data can be done using the `newRecord()` method of a model:

Expand Down

0 comments on commit 0ba1ca5

Please sign in to comment.