Skip to content

Commit d07daa8

Browse files
committed
Moved PRAGMA SQL to enum.
1 parent bdc342d commit d07daa8

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

packages/web/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,7 @@ export class WASQLiteDBAdapter extends BaseObserver<DBAdapterListener> implement
8888
this.logger.warn('Multiple tabs are not enabled in this browser');
8989
}
9090

91-
let tempStorePragma = 'PRAGMA temp_store = memory;';
92-
93-
if (this.options.temporaryStorage === TemporaryStorageOption.FILESYSTEM) {
94-
tempStorePragma = 'PRAGMA temp_store = file;';
95-
}
91+
const tempStorePragma = this.options.temporaryStorage ?? TemporaryStorageOption.MEMORY;
9692

9793
if (useWebWorker) {
9894
const optionsDbWorker = this.options.worker;

packages/web/src/db/adapters/web-sql-flags.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ export interface ResolvedWebSQLOpenOptions extends SQLOpenOptions {
4343
}
4444

4545
export enum TemporaryStorageOption {
46-
MEMORY = 'MEMORY',
47-
FILESYSTEM = 'FILESYSTEM'
46+
MEMORY = 'PRAGMA temp_store = memory;',
47+
FILESYSTEM = 'PRAGMA temp_store = file;'
4848
}
4949

5050
/**

0 commit comments

Comments
 (0)