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

Re: [indexeddb] Do we need to support keyPaths with an empty string?

From: ben turner <bent.mozilla@gmail.com>
Date: Fri, 20 Jan 2012 12:23:21 -0800
Message-ID: <CAGcTs++9YcuPnHzoXq9K0=6P8wBdWGE3LqFe4EEQtFp_0ukZ=w@mail.gmail.com>
To: Israel Hilerio <israelh@microsoft.com>
Cc: Joshua Bell <jsbell@chromium.org>, Odin HÝrthe Omdal <odinho@opera.com>, "Jonas Sicking (jonas@sicking.cc)" <jonas@sicking.cc>, Adam Herchenroether <aherchen@microsoft.com>, David Sheldon <dsheldon@microsoft.com>, "public-webapps@w3.org" <public-webapps@w3.org>
Mozilla is fine with removing the special |keyPath:""| behavior.
Please note that this will also mean that step 1 of the algorithm here


will need to change.

We do want to continue to allow set behavior without specifying the
key twice, though, so we would propose adding an additional option to
createObjectStore to accomplish this:

  // Old way:
  var set = db.createObjectStore("mySet", { keyPath:"" });

  // New way:
  var set = db.createObjectStore("mySet", { isSet: true });

(We are not in love with "isSet", better names are highly encouraged!)

What do you all think? This would allow us to continue to support nice
set behavior without making the empty string "magic".

Received on Friday, 20 January 2012 20:24:10 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:38 UTC