Re: [IndexedDB] Support queries retrieving disjoint sets of keys (#19)

My assumption is that we'd support this anywhere the spec uses _query_ as a parameter and accepts a key-or-range today, namely:

* IDBObjectStore
 * delete — deletes all
 * count — counts all
 * get — gets first
 * getKey — gets first key
 * getAll — gets all
 * getAllKeys — gets all keys
 * openCursor — iterates over all
 * openKeyCursor — iterates over all
* IDBIndex
 * count — counts all
 * get — gets first
 * getKey — gets first key
 * getAll — gets all
 * getAllKeys — gets all keys
 * openCursor — iterates over all
 * openKeyCursor — iterates over all

Order of results needs to be defined for everything except delete and count. E.g., assume a store that contains records with keys 1, 2, 3, 4:

`store.openCursor(new IDBKeySet(4, 3, 2, 1))` — Iteration: what order?
`store.getAll(new IDBKeySet(4, 3, 2, 1))` — Compound result: what order?
`store.get(new IDBKeySet(4, 3, 2, 1))` — Single result: but which?

This impacts how we'd write algorithms like _steps for retrieving a value from an object store_ when we use a generic _query_ instead of a _range_ as input, which e.g. currently says _Let record be the first record in store's list of records whose key is in range, if any._ If we treat "set" as a new type of query then logically we'd say "first record in store's list of records whose key matches query" and then define "matches query" to handle sets or ranges.


---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/19#issuecomment-182045396

Received on Tuesday, 9 February 2016 20:21:39 UTC