-
-
Notifications
You must be signed in to change notification settings - Fork 668
Understanding the basics
David Fahlander edited this page Jun 22, 2016
·
2 revisions
IndexedDB (and Dexie) has a built-in system for db installation and schema upgrades. This is something that many users have had problems to understand. I get the same questions over and over. People try to do these things manually.
Your app should have a dedicated module where you create a Dexie instance and specify its version(s) and schema(s). This module should be required where your database is needed.
appdb.js:
var db = new Dexie('dbname');
db.version(1).stores({
friends: 'name, age'
});
First time a browser hits the appdb.js code the following happens:
- TBD...
Second time ...
Dexie.js - minimalistic and bullet proof indexedDB library