Opened 5 years ago

Last modified 3 years ago

#18255 assigned defect

Setting custom keyPath on indexedDB broken

Reported by: carey Owned by: Kris Zyp
Priority: blocker Milestone: 1.15
Component: DojoX Data Version: 1.10.0
Keywords: Cc:
Blocked By: Blocking:

Description

Hi, I would like to set the keyPath in dojox/store/db/indexedDB.js to something other than "id".

It appears to be able to be set using the storeConfig eg line 150

var idProperty = storeConfig.idProperty || 'id';
var idbStore = db.createObjectStore(storeName, {
  keyPath: idProperty,
  autoIncrement: storeConfig[idProperty] && storeConfig[idProperty].autoIncrement || false
});

However to do so would need to a dbConfig constructed as follows

var dbConfig = {
name: "App-DB",
version: 1, 
stores: {
  mydb: {
    idProperty: "_id",
    aField: {}
    }
  }
}

which breaks the subsequent index creation as it is not expecting the idProperty string in the mydb object only field objects.

Seems either the place the idProperty is passed is wrong or the loop over index fields needs to be smarter to omit the idProperty parameter.

Change History (6)

comment:1 Changed 5 years ago by dylan

Component: DojoxDojoX Data
Milestone: tbd1.10.1
Owner: set to Kris Zyp
Priority: undecidedhigh
Status: newassigned

comment:2 Changed 5 years ago by Colin Snover

Milestone: 1.10.11.10.2

1.10.1 has been released, retargeting all open tickets to next milestone.

comment:3 Changed 5 years ago by Colin Snover

Milestone: 1.10.21.10.3

1.10.2 has been released; moving to next milestone.

comment:4 Changed 4 years ago by dylan

Milestone: 1.10.31.11
Priority: highblocker

comment:5 Changed 3 years ago by dylan

Milestone: 1.111.12

Pushing to 1.12 unfortunately as we need a patch or PR to proceed with this, and I haven't had time to create one.

comment:6 Changed 3 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.