aboutsummaryrefslogtreecommitdiff
path: root/src/util/query.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-03-12 00:44:28 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-03-12 00:44:28 +0530
commit2c52046f0bf358a5e07c53394b3b72d091356cce (patch)
tree8993c992b9c8240ee865671cdfbab380e61af96c /src/util/query.ts
parent6e2881fabf74a3c1da8e94dcbe3e68fce6080d9e (diff)
downloadwallet-core-2c52046f0bf358a5e07c53394b3b72d091356cce.tar.xz
full recoup, untested/unfinished first attempt
Diffstat (limited to 'src/util/query.ts')
-rw-r--r--src/util/query.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/query.ts b/src/util/query.ts
index 95ef30e1b..d08c901a4 100644
--- a/src/util/query.ts
+++ b/src/util/query.ts
@@ -271,6 +271,14 @@ export class TransactionHandle {
return new ResultStream<T>(req);
}
+ iterIndexed<S extends IDBValidKey,T>(
+ index: Index<S, T>,
+ key?: any,
+ ): ResultStream<T> {
+ const req = this.tx.objectStore(index.storeName).index(index.indexName).openCursor(key);
+ return new ResultStream<T>(req);
+ }
+
delete<T>(store: Store<T>, key: any): Promise<void> {
const req = this.tx.objectStore(store.name).delete(key);
return requestToPromise(req);