var index = app.db.transaction(“STORE”).objectStore(“STORE”).index(“indexName”);
index.openCursor( IDBKeyRange.only([“en”,”something”]) ).onsuccess = function(event) {
var cursor = event.target.result;
alert(cursor);
}
never gets a result. The entry IS in the database and you get an IDB Exception 5. You can work around this issue by not using the compound index and instead receive all entries with a specific “locale” and iterate over them until you get the wanted “order”. This is inefficient if the database grows.
IndexedDB Compound Index not working
As we all know, Tizen uses a webkit prefixed Version of indexedDB. If using a compound index, you cannot retrieve data:
{ name: “indexName”, keyPath: [“locale”, “order”], options: {unique: false} }
var index = app.db.transaction(“STORE”).objectStore(“STORE”).index(“indexName”);
index.openCursor( IDBKeyRange.only([“en”,”something”]) ).onsuccess = function(event) {
var cursor = event.target.result;
alert(cursor);
}
never gets a result. The entry IS in the database and you get an IDB Exception 5. You can work around this issue by not using the compound index and instead receive all entries with a specific “locale” and iterate over them until you get the wanted “order”. This is inefficient if the database grows.
Testet in current emulator.
BY
16 Apr 2025
Tizen Studio
BY
04 Nov 2024
Tizen Studio
BY
02 Apr 2024
Tizen Studio