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 <jo...@sicking.cc> wrote:

> On Fri, Feb 4, 2011 at 11:14 AM, Shawn Wilsher <sdwi...@mozilla.com>
> wrote:
> > On 2/1/2011 11:00 AM, bugzi...@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
>
>

Reply via email to