Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-06-17 Thread Nikunj Mehta
Would be useful to bear in mind the semantics of the two methods: 1. If storing a record in an index that allows multiple values for a single key, a. add is going to store an extra record for an existing key, if it exists. b. put is also going to store a new record for the existing key, if it

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-06-17 Thread Jonas Sicking
On Thu, Jun 17, 2010 at 10:33 AM, Shawn Wilsher wrote: > On 6/17/2010 10:26 AM, Kris Zyp wrote: >> >> My order of preference: >> 1. parameter-based: >> put(record, {id: "some-id", overwrite: false, ... other parameters ..}); >> This leaves room for future parameters without a long positional >> op

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-06-17 Thread Shawn Wilsher
On 6/17/2010 10:26 AM, Kris Zyp wrote: My order of preference: 1. parameter-based: put(record, {id: "some-id", overwrite: false, ... other parameters ..}); This leaves room for future parameters without a long positional optional parameter list, which becomes terribly confusing and difficult to r

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-06-17 Thread Kris Zyp
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 6/17/2010 10:24 AM, Jeremy Orlow wrote: > > On Wed, Jun 16, 2010 at 9:58 AM, Shawn Wilsher > wrote: > > So, in summary, I agree to splitting the put method in to > two - put and putNoOverwrite. I am al

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-06-17 Thread Jeremy Orlow
On Wed, Jun 16, 2010 at 11:08 AM, Jonas Sicking wrote: > On Wed, Jun 16, 2010 at 10:46 AM, Nikunj Mehta > wrote: > > > > On Jun 16, 2010, at 9:58 AM, Shawn Wilsher wrote: > > > >> On 6/16/2010 9:43 AM, Nikunj Mehta wrote: > >>> There are three theoretical modes as you say. However, the second mo

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-06-16 Thread Nikunj Mehta
When you get to the cursor, the object already existed. This is the case where the update occurs on an existing object and put means put because it already exists. On Jun 16, 2010, at 11:19 AM, Mikeal Rogers wrote: > I don't have an opinion about addOrModify but in the Firefox build I'm > messi

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-06-16 Thread Mikeal Rogers
I don't have an opinion about addOrModify but in the Firefox build I'm messing with the cursor has an update method that I find highly useful and efficient. -Mikeal On Wed, Jun 16, 2010 at 11:08 AM, Jonas Sicking wrote: > On Wed, Jun 16, 2010 at 10:46 AM, Nikunj Mehta wrote: >> >> On Jun 16, 20

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-06-16 Thread Jonas Sicking
On Wed, Jun 16, 2010 at 10:46 AM, Nikunj Mehta wrote: > > On Jun 16, 2010, at 9:58 AM, Shawn Wilsher wrote: > >> On 6/16/2010 9:43 AM, Nikunj Mehta wrote: >>> There are three theoretical modes as you say. However, the second mode does >>> not exist in practice. If you must overwrite, then you kno

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-06-16 Thread Nikunj Mehta
On Jun 16, 2010, at 9:58 AM, Shawn Wilsher wrote: > On 6/16/2010 9:43 AM, Nikunj Mehta wrote: >> There are three theoretical modes as you say. However, the second mode does >> not exist in practice. If you must overwrite, then you know that the record >> exists and hence don't need to specify t

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-06-16 Thread Shawn Wilsher
On 6/16/2010 9:43 AM, Nikunj Mehta wrote: There are three theoretical modes as you say. However, the second mode does not exist in practice. If you must overwrite, then you know that the record exists and hence don't need to specify that option. To be clear, you are saying that there are only

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-06-16 Thread Nikunj Mehta
On May 10, 2010, at 10:36 AM, Kris Zyp wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 5/7/2010 1:32 PM, Shawn Wilsher wrote: >> Hey all, >> >> Per the current spec [1], noOverwrite defaults to false for put >> operations on an object store. Ben Turner and I have been >> discus

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-05-10 Thread Kris Zyp
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 5/10/2010 12:53 PM, Maciej Stachowiak wrote: > > On May 10, 2010, at 10:36 AM, Kris Zyp wrote: > >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 >> >> On 5/7/2010 1:32 PM, Shawn Wilsher wrote: >>> Hey all, >>> >>> Per the current spec [1], noOve

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-05-10 Thread Maciej Stachowiak
On May 10, 2010, at 10:36 AM, Kris Zyp wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 5/7/2010 1:32 PM, Shawn Wilsher wrote: Hey all, Per the current spec [1], noOverwrite defaults to false for put operations on an object store. Ben Turner and I have been discussing changing the de

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-05-10 Thread Shawn Wilsher
On 5/10/2010 10:36 AM, Kris Zyp wrote: I believe there are three useful modes: overwrite: false - Must create a new record overwrite: true - Must overwrite/update an existing record (something else) - Create a new record or overwrite/update an existing (depending on the key of course). FWIW, righ

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-05-10 Thread Kris Zyp
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 5/7/2010 1:32 PM, Shawn Wilsher wrote: > Hey all, > > Per the current spec [1], noOverwrite defaults to false for put > operations on an object store. Ben Turner and I have been > discussing changing the default of put to not allow overwriting by

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-05-10 Thread Shawn Wilsher
On 5/10/2010 1:33 AM, Jeremy Orlow wrote: Either sounds fine to me. Please open something in the bug tracker? Filed bug 9698 [1] on changing noOverwrite to overwrite. I'm going to wait to file a bug about changing the default until we get more feedback. Cheers, Shawn [1] http://www.w3.org/

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-05-10 Thread Vivek Khurana
On Sat, May 8, 2010 at 1:02 AM, Shawn Wilsher wrote: > Hey all, > > Per the current spec [1], noOverwrite defaults to false for put operations > on an object store.  Ben Turner and I have been discussing changing the > default of put to not allow overwriting by default.  We feel this is better > b

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-05-10 Thread Jeremy Orlow
Either sounds fine to me. Please open something in the bug tracker? On Fri, May 7, 2010 at 10:12 PM, ben turner wrote: > I think that switching 'noOverwrite' from false to true is confusing. > I definitely vote to rename the parameter to 'overwrite' and and keep > the default as false. > > -Ben

Re: [IndexedDB] Changing the default overwrite behavior of Put

2010-05-07 Thread ben turner
I think that switching 'noOverwrite' from false to true is confusing. I definitely vote to rename the parameter to 'overwrite' and and keep the default as false. -Ben On Fri, May 7, 2010 at 12:32 PM, Shawn Wilsher wrote: > Hey all, > > Per the current spec [1], noOverwrite defaults to false for

[IndexedDB] Changing the default overwrite behavior of Put

2010-05-07 Thread Shawn Wilsher
Hey all, Per the current spec [1], noOverwrite defaults to false for put operations on an object store. Ben Turner and I have been discussing changing the default of put to not allow overwriting by default. We feel this is better behavior because simply omitting the flag should not result i