indexeddb

No way to delete IndexedDB under Google Chrome

拜拜、爱过 提交于 2019-12-06 05:30:25
How to delete IndexedDBs in Google Chrome? I've performed "Clear browsing data" and nothing happened. There is still bunch of IndexedDB from different domains... All other data has been removed. In Developer Tools is no option to delete IndexedDB. According to: http://code.google.com/p/chromium/issues/detail?id=116372 You will have the option to clear indexedDB (and other client side storage options like: localstorage etc') soon... According to http://code.google.com/p/chromium/issues/detail?id=64050 , IndexedDB directories don't get deleted if there are open connections to them. Have you

IndexedDB - What is Key, keyPath and indexName?

坚强是说给别人听的谎言 提交于 2019-12-06 05:09:29
问题 I am coming from MySQL and I am used to the conventional database table scheme. I am having trouble understanding IndexedDB and some of its terminology. I looked up these definitions in the documentation: Key A data value by which stored values are organized and retrieved in the object store. indexName The name of the index to create. keyPath The key path for the index to use. Basically, Key is like a Primary Key in MySQL, right? Is indexName the same thing as a column? And I don't understand

How to get multiple key value from IndexedDb objectstore

与世无争的帅哥 提交于 2019-12-06 04:53:14
Can somebody suggest how to get multiple key value from IndexedDB objectstore ? I have done multiple options, but didn't work none. Created indexedDb here $provide.value('dbModel', { name: 'TestDB', version: '1', instance: {}, objectStoreName: { dashboards: 'Appointment' }, upgrade: function (e) { var db = e.target.result; if (!db.objectStoreNames.contains('Appointment')) { var calendarobj = db.createObjectStore('Appointment', { keyPath: 'AppointmentId' }); calendarobj.createIndex("AppointmentId", "AppointmentId", { multiEntry: true }); } } }); And the Data looks like KeyPath-AppointmentId

IndexedDB very slow compared to WebSQL, what am i doing wrong?

吃可爱长大的小学妹 提交于 2019-12-06 04:53:02
问题 I made a demo chrome extension to compare websql and indexeddb and to learn how both worked in more detail. To my surprise it showed that indexeddb is a lot slower even compared to the most naive sql command. Since websql have been deprecated in favor of indexeddb i assumed indexeddb would be as fast or faster than websql. I'm assuming i'm doing something wrong in the indexeddb code. Because deprecating something that is much faster would be stupid and i assume they knew what they were doing

Indexeddb: Differences between onsuccess and oncomplete?

若如初见. 提交于 2019-12-06 04:01:07
问题 I use two different events for the callback to respond when the IndexedDB transaction finishes or is successful: Let's say... db : IDBDatabase object, tr : IDBTransaction object, os : IDBObjectStore object tr = db.transaction(os_name,'readwrite'); os = tr.objectStore(); case 1 : r = os.openCursor(); r.onsuccess = function(){ if(r.result){ callback_for_result_fetched(); r.result.continue; }else callback_for_transaction_finish(); } case 2: tr.oncomplete = callback_for_transaction_finish(); It

Indexeddb adds a new value instead of updating an existing value

北城余情 提交于 2019-12-06 02:34:29
When attempting to update a record within indexeddb using the put method, it appears that a new value is created rather than a change. According to MDN this is the method to update a record, yet I'm not having the expected result. Any ideas? Here is my code example. /* @keys initalisation */ extension.onupgradeneeded = function (event) { database = event.target.result; if (!database.objectStoreNames.contains('profile')) { var _profile = database.createObjectStore('profile', { autoIncrement: true }); _profile.createIndex('default', 'default', { unique: true }); _profile.createIndex('username',

Is IndexedDB on Safari guaranteed to be persistent?

孤人 提交于 2019-12-06 02:19:47
Similar to this question , is IndexedDB guaranteed to be persistent ? ie. Safari will not reclaim disk space if the device is low on memory. Safari have " No Eviction policy ", meaning it will not automatically clean the IndexDB on low disk pressure, without user doing it manually. IndexDB is one of the fast evolving feature and you can expect to have a different eviction policy any time with no announcement. You should always build with fall back options. Chrome has explicit persistent storage option which will guarantee no eviction, on user approval for persistent storage and we can expect

IndexedDB and Relationships

隐身守侯 提交于 2019-12-06 00:37:39
问题 Can I create relationships between my object stores in IndexedDB? For example, I have two object stores: artist and album . An artist has a one-to-many relationship with an album . album.artistId relates the album to artist.id . I'm thinking along the lines of Hibernate here. I would like to do a query for artists and have the albums belonging to that artist returned as an array called artists on the album object. artist.albums = []; Follow Up (4.5 years later, 2017) There are some great

How do I specify key when adding records to objectStore w/ in IndexedDB?

∥☆過路亽.° 提交于 2019-12-05 20:39:57
Trying to learn the concepts and API of IndexedDB and I'm struggling trying to figure out how to specify keys for an objectStore using the IDBObjectStore.add method. According to the spec, the first parameter is the value and the second optional parameter is the key. I can add a record when I supply an object that has Bar as a property of the value (which is an object), but when I try to pass the key in through an object via the second parameter, the add attempt fails and the details that I get are: Code: 5. Message: DataError: DOM IDBDatabase Exception 5. Name: DataError. Stack: Error: The

How do I update data in indexedDB?

て烟熏妆下的殇ゞ 提交于 2019-12-05 19:15:11
问题 I have tried to get some information from W3C regarding the update of an objectStore item in a indexedDB database, but with not so much susccess. I found here a way to do it, but it doesn't really work for me. My implementation is something like this DBM.activitati.edit = function(id, obj, callback){ var transaction = DBM.db.transaction(["activitati"], IDBTransaction.READ_WRITE); var objectStore = transaction.objectStore("activitati"); var keyRange = IDBKeyRange.only(id); objCursor =