Skip to content

Commit a6ebf4f

Browse files
IDB: SQLite store - implement index creation and cursors
createIndex() and cursors (both key-only and with value) work. count() is implemented but needs triggers to function correctly. Triggers are needed also to remove "tombstones", i.e., the outdated index entries from when an object store record has been updated. Bug: 419203258 Change-Id: I989ecb13327e74b3e44dfc6d464af510d625ecb5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6657621 Reviewed-by: Evan Stade <[email protected]> Commit-Queue: Abhishek Shanthkumar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1477242}
1 parent 42cf14b commit a6ebf4f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

IndexedDB/idbindex_tombstones.any.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ async function run_test(testCase, transactionMode, direction) {
4646
IDBKeyRange.bound(-11, 11), direction);
4747
let results = await iterateAndReturnAllCursorResult(testCase, cursor);
4848
assert_equals(results.length, 3);
49+
// Verify count().
50+
await new Promise((resolve, reject) => {
51+
const countRequest = txn.objectStore('objectStore').index('index').count();
52+
countRequest.onsuccess = testCase.step_func(event => {
53+
assert_equals(event.target.result, 3);
54+
resolve();
55+
});
56+
countRequest.onerror = reject;
57+
});
4958
db.close();
5059
}
5160

0 commit comments

Comments
 (0)