backbone-indexeddb
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -16,4 +16,4 @@ (function () { /*global _: false, Backbone: false */ | ||
} | ||
// Naming is a mess! | ||
@@ -25,7 +25,7 @@ var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.msIndexedDB ; | ||
window.IDBCursor = window.IDBCursor || window.webkitIDBCursor || window.mozIDBCursor || window.msIDBCursor ; | ||
// Driver object | ||
// That's the interesting part. | ||
// There is a driver for each schema provided. The schema is a te combination of name (for the database), a version as well as migrations to reach that | ||
// There is a driver for each schema provided. The schema is a te combination of name (for the database), a version as well as migrations to reach that | ||
// version of the database. | ||
@@ -256,3 +256,3 @@ function Driver(schema, ready, nolog) { | ||
create: function (storeName, object, options) { | ||
var writeTransaction = this.db.transaction([storeName], IDBTransaction.READ_WRITE); | ||
var writeTransaction = this.db.transaction([storeName], 'readwrite'); | ||
//this._track_transaction(writeTransaction); | ||
@@ -265,3 +265,3 @@ var store = writeTransaction.objectStore(storeName); | ||
if (json.id === null) delete json.id; | ||
if (!store.keyPath) | ||
@@ -279,7 +279,7 @@ writeRequest = store.add(json, json.id); | ||
}, | ||
// Writes the json to the storeName in db. It is an update operation, which means it will overwrite the value if the key already exist | ||
// options are just success and error callbacks. | ||
update: function (storeName, object, options) { | ||
var writeTransaction = this.db.transaction([storeName], IDBTransaction.READ_WRITE); | ||
var writeTransaction = this.db.transaction([storeName], 'readwrite'); | ||
//this._track_transaction(writeTransaction); | ||
@@ -305,3 +305,3 @@ var store = writeTransaction.objectStore(storeName); | ||
// Reads from storeName in db with json.id if it's there of with any json.xxxx as long as xxx is an index in storeName | ||
// Reads from storeName in db with json.id if it's there of with any json.xxxx as long as xxx is an index in storeName | ||
read: function (storeName, object, options) { | ||
@@ -345,3 +345,3 @@ var readTransaction = this.db.transaction([storeName], "readonly"); | ||
delete: function (storeName, object, options) { | ||
var deleteTransaction = this.db.transaction([storeName], IDBTransaction.READ_WRITE); | ||
var deleteTransaction = this.db.transaction([storeName], 'readwrite'); | ||
//this._track_transaction(deleteTransaction); | ||
@@ -533,3 +533,3 @@ | ||
// Method used by Backbone for sync of data with data store. It was initially designed to work with "server side" APIs, This wrapper makes | ||
// Method used by Backbone for sync of data with data store. It was initially designed to work with "server side" APIs, This wrapper makes | ||
// it work with the local indexedDB stuff. It uses the schema attribute provided by the object. | ||
@@ -582,4 +582,4 @@ // The wrapper keeps an active Executuon Queue for each "schema", and executes querues agains it, based on the object type (collection or | ||
} | ||
//window.addEventListener("unload",function(){Backbone.sync("closeall")}) | ||
})(); |
@@ -5,3 +5,3 @@ { | ||
"description": "An backbone adapter for indexeddb. Useless for most people untile indexeddb is ported to the browser", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
261692