[spec-reviews] Indexed DB getAll(), openKeyCursor() and objectStoreNames (#84)

There are a handful of new methods/attributes in the Indexed DB "Second Edition" with implementations in both FF and Chrome that we'd like feedback on. These are additions of new methods to existing interface objects in the API, and do not change the behavior of any existing methods. All can be feature detected.

[IDBObjectStore.getAll()](https://w3c.github.io/IndexedDB/#dom-idbobjectstore-getall)
[IDBObjectStore.getAllKeys()](https://w3c.github.io/IndexedDB/#dom-idbobjectstore-getallkeys)
[IDBIndex.getAll()](https://w3c.github.io/IndexedDB/#dom-idbindex-getall)
[IDBIndex.getAllKeys()](https://w3c.github.io/IndexedDB/#dom-idbindex-getallkeys)

Like get()/getKey(), these take a query (null or key or key range), but also an optional count, and yield a JS Array with all matching results. The alternatives today are issuing multiple parallel get() calls (if keys are known) or iterating a cursor over the range (if keys are not known). Avoiding multiple event dispatches can be a significant performance improvement and reduce main thread contention, as well as simplifying application logic.

[IDBObjectStore.openKeyCursor()](https://w3c.github.io/IndexedDB/#dom-idbobjectstore-openkeycursor)

IDBIndex has openCursor() and openKeyCursor(), where the latter avoids fetching values and saves on the transport/deserialization overhead when only existence testing is known, e.g. for joins. This gives IDBObjectStore the same lighter-weight option in addition to the existing IDBObjectStore.openCursor()

[IDBTransaction.objectStoreNames](https://w3c.github.io/IndexedDB/#dom-idbtransaction-objectstorenames)

This is a convenience attribute that yields the stores in the scope of the transaction, as specified when starting the transaction. For upgrade transactions it yields the same thing as db.objectStoreNames. This attribute has shipped (unprefixed, not behind a flag) in FF for many versions.

> NOTE: There are other additions marked "new in this edition" in the ED; we are not as far along with design/review/discussion of those. Also, there are discussions around integration with Promises, improvements to indexes and transactions, more powerful queries, and a several other additional features - see https://github.com/w3c/IndexedDB/issues - that haven't made it into the ED. So right now we're hoping for feedback on just the subset above.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/spec-reviews/issues/84

Received on Thursday, 24 September 2015 22:55:30 UTC