Skip to content

Dexie.[table]

David Fahlander edited this page Mar 20, 2015 · 6 revisions

Syntax

var db = new Dexie(dbName);
db.version(1).stores({table1: "...", table2: "..."});
db.open();

assert (db.table1 instanceOf db.WriteableTable);
assert (db.table2 instanceOf db.WriteableTable);

Type

WriteableTable

NOTES

This is a dynamic property and the current transaction state will affect the resulting WriteableTable instance returned. So do not store the result of this property somewhere else beacuse then it stop executing its operations within the current transaction scope at the time you do operations on it. See this post that explains a bit of that.

Sample

var db = new Dexie("MyDB");
db.version(1).stores({friends: "++id,name,gender", pets: "++id,name,kind"});
db.open();

db.friends.add({name: "Simon", gender: "male"});
db.pets.add({name: "Josephina", kind: "dog"});
Clone this wiki locally