Skip to content

Commit

Permalink
Merge pull request #623 from tchak/rationalize-indexes
Browse files Browse the repository at this point in the history
Rationalize indexes
  • Loading branch information
dgeb authored Apr 15, 2019
2 parents 8d1acb2 + b7e38d6 commit 1a51006
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/@orbit/indexeddb/src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,7 @@ export default class IndexedDBCache extends AsyncRecordCache {

createInverseRelationshipStore(db: IDBDatabase): void {
let objectStore = db.createObjectStore(INVERSE_RELS, { keyPath: 'id' });
objectStore.createIndex('type', 'type', { unique: false });
objectStore.createIndex('recordIdentity', 'recordIdentity', { unique: false });
objectStore.createIndex('relatedType', 'relatedType', { unique: false });
objectStore.createIndex('relatedIdentity', 'relatedIdentity', { unique: false });
}

/**
Expand Down Expand Up @@ -443,7 +440,7 @@ export default class IndexedDBCache extends AsyncRecordCache {
const transaction = this._db.transaction([INVERSE_RELS]);
const objectStore = transaction.objectStore(INVERSE_RELS);
const results: RecordRelationshipIdentity[] = [];
const keyRange = IDBKeyRange.only(serializeRecordIdentity(recordIdentity));
const keyRange = Orbit.globals.IDBKeyRange.only(serializeRecordIdentity(recordIdentity));
const request = objectStore.index('recordIdentity').openCursor(keyRange);

request.onerror = function(/* event */) {
Expand Down

0 comments on commit 1a51006

Please sign in to comment.