diff options
Diffstat (limited to 'packages/taler-wallet-core/src/util')
-rw-r--r-- | packages/taler-wallet-core/src/util/query.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/util/query.ts b/packages/taler-wallet-core/src/util/query.ts index 56a23c2dd..0efda88cf 100644 --- a/packages/taler-wallet-core/src/util/query.ts +++ b/packages/taler-wallet-core/src/util/query.ts @@ -670,6 +670,23 @@ export class DbAccess<StoreMap> { accessibleStores[sn] = swi; } + const storeMapKeys = Object.keys(this.stores as any); + for (const storeMapKey of storeMapKeys) { + const swi = (this.stores as any)[storeMapKey] as StoreWithIndexes< + any, + any, + any + >; + if (!accessibleStores[swi.storeName]) { + const version = this.db.version; + throw Error( + `store '${swi.storeName}' required by schema but not in database (minver=${version})`, + ); + } + } + + logger.info(`accessible stores: ${Object.keys(accessibleStores)}`); + const runReadOnly = <T>( txf: ReadOnlyTransactionFunction<StoreMap, T>, ): Promise<T> => { |