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

This may be naive, but what about supporting a generic predicate function akin to Array.prototype.find or the NodeFilter function argument to createNodeIterator? How hard is it to translate an arbitrary, user-defined predicate into something that can still provide great performance? Is it simply not feasible? I understand that a predicate could provide too much flexibility. Maybe there could some some simple extra rules about what a predicate can contain? Maybe some validation of the predicate occurs once at the start, throws some type of DOM error is not allowed, maybe there is some upfront compilation of the function's intent into C++ land, maybe the function is invalid if it tries to access variables in outer scope or globals, and so forth.

`var request = store.openCursor(function myCustomPredicateFunction(object) {`
`  return object.id in [1, 4, 3, 2];`
`});`

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

Received on Sunday, 21 February 2016 13:08:55 UTC