Re: [IndexedDB] Computed indexes

2010-06-28 Thread Jonas Sicking
I trimmed this thread quite a bit since there now seems to be less talking past each other. Feel free to bring back any part if you think I've trimmed too agressively. What is the difference between an expressionIndex and a keyPath?  It seems like they're doing about the same thing.  

Re: [IndexedDB] Computed indexes

2010-06-28 Thread Jeremy Orlow
On Tue, Jun 29, 2010 at 7:21 AM, Jonas Sicking jo...@sicking.cc wrote: I'm pretty convinced that complex indexes is something that people need to do. However it's entirely possible that simply using a separate objectStore is good enough for v1. More details below. Though maybe people can

Re: [IndexedDB] Computed indexes

2010-06-28 Thread Shawn Wilsher
On 6/28/2010 4:59 PM, Jeremy Orlow wrote: Gotcha. Yeah, this technique can be used to replace any use case for explicitly managed indexes. And, for that reason, I think we should just get rid of them now. Agreed. As for whether we should have a feature to compute index keys via a function:

Re: [IndexedDB] Computed indexes

2010-06-26 Thread Jonas Sicking
On Thu, Jun 24, 2010 at 7:01 AM, Jeremy Orlow jor...@chromium.org wrote: 4. Maciej expressed concern that this might make it impossible to expose IndexedDB to non-JS languages such as ObjectiveC Let me address these in order (for the purposes of this discussion I'll use a separate

Re: [IndexedDB] Computed indexes

2010-06-26 Thread Jeremy Orlow
On Sat, Jun 26, 2010 at 12:11 PM, Jonas Sicking jo...@sicking.cc wrote: On Thu, Jun 24, 2010 at 7:01 AM, Jeremy Orlow jor...@chromium.org wrote: 4. Maciej expressed concern that this might make it impossible to expose IndexedDB to non-JS languages such as ObjectiveC Let me address

Re: [IndexedDB] Computed indexes

2010-06-24 Thread Shawn Wilsher
On 6/24/2010 7:01 AM, Jeremy Orlow wrote: So what your proposing is that the keyPath would essentially be a string of the body of a function which runs for every index (on that objectStore) for every value inserted into that object store? This seems like half way between the eval-like idea I

Re: [IndexedDB] Computed indexes

2010-06-24 Thread Jeremy Orlow
On Thu, Jun 24, 2010 at 3:48 PM, Shawn Wilsher sdwi...@mozilla.com wrote: On 6/24/2010 7:01 AM, Jeremy Orlow wrote: So what your proposing is that the keyPath would essentially be a string of the body of a function which runs for every index (on that objectStore) for every value inserted

Re: [IndexedDB] Computed indexes

2010-06-23 Thread Jonas Sicking
On Sat, Jun 19, 2010 at 1:05 AM, Jonas Sicking jo...@sicking.cc wrote:  Maybe we could make the global scope be empty when compiling (so variables can't be bound) and executing the function? Yes, we absolutely should. Forgot to mention this. What is the difference between an expressionIndex

Re: [IndexedDB] Computed indexes

2010-06-19 Thread Jonas Sicking
On Fri, Jun 18, 2010 at 7:42 PM, Jeremy Orlow jor...@chromium.org wrote: On Thu, Jun 17, 2010 at 3:25 PM, Jonas Sicking jo...@sicking.cc wrote: Hi All, We've debated a bit use cases like storing objects like: { name: Elvis, born: January 8, 1935, died: August 16, 1977 } { name: Gustav III,

Re: [IndexedDB] Computed indexes

2010-06-18 Thread Jeremy Orlow
On Thu, Jun 17, 2010 at 3:25 PM, Jonas Sicking jo...@sicking.cc wrote: Hi All, We've debated a bit use cases like storing objects like: { name: Elvis, born: January 8, 1935, died: August 16, 1977 } { name: Gustav III, born: 24 January 1746, died: 29 March 1792 } And create an index based

[IndexedDB] Computed indexes

2010-06-17 Thread Jonas Sicking
Hi All, We've debated a bit use cases like storing objects like: { name: Elvis, born: January 8, 1935, died: August 16, 1977 } { name: Gustav III, born: 24 January 1746, died: 29 March 1792 } And create an index based on the age at time of death. Similarly, store HTML documents and index on the