From 531fc4fedddd6fbe2d32fbb22d3e0b758f248c1a Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Mon, 15 Apr 2019 11:38:29 +0200 Subject: [PATCH 1/2] Use IDBKeyRange from Orbit.globals --- packages/@orbit/indexeddb/src/cache.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@orbit/indexeddb/src/cache.ts b/packages/@orbit/indexeddb/src/cache.ts index 09920ebb2..004e6912d 100644 --- a/packages/@orbit/indexeddb/src/cache.ts +++ b/packages/@orbit/indexeddb/src/cache.ts @@ -443,7 +443,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 */) { From b7e38d6399a8b6e5de755d113985cbaf86632543 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Mon, 15 Apr 2019 11:38:49 +0200 Subject: [PATCH 2/2] Rationalize IndexedDB indexes --- packages/@orbit/indexeddb/src/cache.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/@orbit/indexeddb/src/cache.ts b/packages/@orbit/indexeddb/src/cache.ts index 004e6912d..3f74d87e2 100644 --- a/packages/@orbit/indexeddb/src/cache.ts +++ b/packages/@orbit/indexeddb/src/cache.ts @@ -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 }); } /**