Basic API
var request = indexedDB.open('my-db', 1);
request.onupgradeneeded = function (e) {
var db = e.target.result;
var store = db.createObjectStore('my-store', {
keyPath: 'id',
autoIncrement: true
});
store.add({
firstName: 'Aaron',
lastName: 'Powell'
});
};
request.onsuccess = function (e) {
var db = e.target.result;
var transaction = db.transaction('my-store');
var store = transaction.objectStore('my-store');
var request = store.get(1);
request.onsuccess = function (e) {
console.log(e.target.result);
};
};