- From: Sunny <notifications@github.com>
- Date: Tue, 11 Jun 2019 18:58:26 -0700
- To: w3c/IndexedDB <IndexedDB@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 12 June 2019 01:58:48 UTC
I have a table 'ccc' in indexeddb, and the count of the 'ccc' is more than 35k.
I want to get all data from ccc using getAll(). But sometimes it will crash.
**Note: once there is a crash, using getAll() to fetch the ccc data will crash always.**
**Workaround: clear the table 'ccc', then store data into indexeddb again, getAll() works fine.**
I tried two implementations, but both had this issue.
Code 1:
var connection = indexedDB.open('Aaa')
connection.onsuccess = (e) => {
var db = e.target.result;
var tr = db.transaction(['ccc'], 'readwrite');
var objectStore = tr.objectStore('ccc')
var request = objectStore.getAll();
request.onsuccess = function() {
const r = request.result;
console.info(r && r.length);
}
}
Code 2:
Using Dexie.Collection toArray() api.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/276
Received on Wednesday, 12 June 2019 01:58:48 UTC