W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2011

Re: [Bug 11948] New: index.openCursor's cursor should have a way to access the index's "value" (in addition to the index's key and objectStore's value)

From: Jeremy Orlow <jorlow@chromium.org>
Date: Fri, 4 Feb 2011 15:30:40 -0800
Message-ID: <AANLkTik29beReYaxo4g78CzHHQn2zrUx6iSiSiTXWMB9@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: Shawn Wilsher <sdwilsh@mozilla.com>, public-webapps@w3.org
We haven't used the term primary key too much in the spec, but I think a lot
might actually be more clear if we used it more.  And I think it'd also make
a good name here.  So I'm OK with that being the name we choose.

Here's another question: what do we set primaryKey to for cursors opened via
index.openKeyCursor and objectStore.openCursor?  It seems as though setting
them to null/undefined could be confusing.  One possibility is to have
.value and .primaryKey be the same thing for the former and .key and
.primaryKey be the same for the latter, but that too could be confusing.  (I
think we have this problem no matter what we name it, but if there were some
name that was more clear in these contexts, then that'd be a good reason to
consider it instead.)

J

For objectStore.openCursor, if we went with primaryKey, then would we set
both key and primaryKey to be the same thing?  Leaving it undefined/null
seems odd.

On Fri, Feb 4, 2011 at 1:36 PM, Jonas Sicking <jonas@sicking.cc> wrote:

> On Fri, Feb 4, 2011 at 11:14 AM, Shawn Wilsher <sdwilsh@mozilla.com>
> wrote:
> > On 2/1/2011 11:00 AM, bugzilla@jessica.w3.org wrote:
> >>
> >> As discussed in the mailing list thread from bug 11257, we should add
> some
> >> way
> >> for index.openCursor cursors to access the primary key for the
> >> objectStore.
> >> .indexValue, .objectStoreKey, or .primaryKey might be good names to use
> >> for it.
> >
> > .objectStoreKey seems to be the most clear way to express this to me.
>
> Oh, I missed that the original bug included a few suggestions. Given
> that both me and Jeremy independently thought of "indexValue" and
> "primaryKey" I think that's a decent sign that they are intuitive
> names. I happen to like "primaryKey" the most as it's really a key
> rather than a value that we've got here.
>
> For some reason objectStoreKey makes me think that it's connected to
> the objectStore rather than the entry in it.
>
> / Jonas
>
>
Received on Friday, 4 February 2011 23:31:31 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:43 GMT