var db;
var version = 1;
var request = indexedDB.open("myDB", version);
request.onsuccess(function(e) {db = e.target.result;});
// db.close(); //??? happens async and has no callback
var request2 = indexedDB.open("myDB", ++version);
request.onsuccess = function() { console.log("success"); };
request.onerror = function() { console.log("error"); }; // called if db existed when page was loaded
request.onblocked = function(){console.log("blocked");}; // called on init creation
request.onupgradeneeded = function(){console.log("onupgradeneeded");};
I need to be able to open the db, read an object store, and then alter the db. It looks like you can only alter the db structure once per page load.
This works just fine in Chrome when using the deprecated setVersion method.