Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Created June 6, 2014 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuc-arc-f/83538b8a82ca3e0c2f48 to your computer and use it in GitHub Desktop.
Save kuc-arc-f/83538b8a82ca3e0c2f48 to your computer and use it in GitHub Desktop.
DbHelper.prototype.getInstance = function( ) {
var db=null;
//open
var rq = indexedDB.open(DB_NAME);
rq.onupgradeneeded = function(result) {
console.log('#onupgradeneeded');
db = this.result;
var store = db.createObjectStore(STORE_NAME, {
keyPath: 'id', // key= id
autoIncrement: false,
});
store.createIndex('byName', 'name');
db.close();
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment