From 668ffa7302d9f1629848c250904fd269979bb8b0 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 1 Dec 2021 18:16:40 +0100 Subject: wallet-core: implement exportDb API call --- packages/taler-wallet-core/src/util/query.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'packages/taler-wallet-core/src/util') diff --git a/packages/taler-wallet-core/src/util/query.ts b/packages/taler-wallet-core/src/util/query.ts index a95cbf1ff..2d0fc077e 100644 --- a/packages/taler-wallet-core/src/util/query.ts +++ b/packages/taler-wallet-core/src/util/query.ts @@ -488,9 +488,12 @@ function makeReadContext( return new ResultStream(req); }, getAll(query, count) { - const req = tx.objectStore(storeName).index(indexName).getAll(query, count); + const req = tx + .objectStore(storeName) + .index(indexName) + .getAll(query, count); return requestToPromise(req); - } + }, }; } ctx[storeAlias] = { @@ -534,9 +537,12 @@ function makeWriteContext( return new ResultStream(req); }, getAll(query, count) { - const req = tx.objectStore(storeName).index(indexName).getAll(query, count); + const req = tx + .objectStore(storeName) + .index(indexName) + .getAll(query, count); return requestToPromise(req); - } + }, }; } ctx[storeAlias] = { @@ -574,6 +580,10 @@ function makeWriteContext( export class DbAccess { constructor(private db: IDBDatabase, private stores: StoreMap) {} + idbHandle(): IDBDatabase { + return this.db; + } + mktx< PickerType extends (x: StoreMap) => unknown, BoundStores extends GetPickerType -- cgit v1.2.3