This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21559 - [IndexedDB] Term "primary key" needs defining
Summary: [IndexedDB] Term "primary key" needs defining
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Indexed Database API (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-03 00:00 UTC by Joshua Bell
Modified: 2013-04-03 17:45 UTC (History)
2 users (show)

See Also:


Attachments

Description Joshua Bell 2013-04-03 00:00:13 UTC
The term "primary key" is used in the spec in a couple of places:

(1)  3.2.6 Index
"getKey - Gets the primary key of the record from the referenced object store entry."

In this case, the word "primary" can simply be dropped; it's already referring to the referenced object store, and the algorithm clearly defines what should happen.

(2) 3.5.7 Cursor Iteration Operation
"If /found record/ is not defined, set /cursor/'s /key/ and primary key to |undefined|."

This blurs the line between the IDBCursor (the IDL interface) and the abstract cursor mechanism defined in 3.1.10. IDBCursor has |key|, |primaryKey| and (for IDBCursorWithValue) |value| attributes. A cursor has /position/, /key/ and /value/ properties, and defines /effective key/ (if the source is an index).

The algorithm should not refer to the IDL attributes, but the properties of the cursor mechanism. 

Given that:

"IDBCursor.primaryKey Returns the cursor's current effective key."
and:
"If the source of a cursor is an index, the effective object store of the cursor is that index's referenced object store and the effective key is the cursor's object store position."

.. then it should be sufficient to state:

"If /found record/ is not defined, set /cursor/'s /key/ to undefined. If /source/ is an index, set /cursor/'s /object store position/ to undefined."
Comment 1 Joshua Bell 2013-04-03 17:45:59 UTC
Made those changes in https://dvcs.w3.org/hg/IndexedDB/rev/fa1c7695ba67