Skip to content

Commit

Permalink
Implemented minor PR feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chriztiaan committed Nov 26, 2024
1 parent 9bac6b6 commit 014138b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions packages/web/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ export class WASQLiteDBAdapter extends BaseObserver<DBAdapterListener> implement
: getWorkerDatabaseOpener(this.options.dbFilename, enableMultiTabs, optionsDbWorker);

this.methods = await dbOpener(this.options.dbFilename);

await this.methods?.execute(tempStoreQuery);
await this.methods!.execute(tempStoreQuery);
this.methods.registerOnTableChange(
Comlink.proxy((event) => {
this.iterateListeners((cb) => cb.tablesUpdated?.(event));
Expand All @@ -118,7 +117,7 @@ export class WASQLiteDBAdapter extends BaseObserver<DBAdapterListener> implement
return;
}
this.methods = await _openDB(this.options.dbFilename, { useWebWorker: false });
await this.methods?.execute(tempStoreQuery);
await this.methods!.execute(tempStoreQuery);
this.methods.registerOnTableChange((event) => {
this.iterateListeners((cb) => cb.tablesUpdated?.(event));
});
Expand Down
5 changes: 3 additions & 2 deletions packages/web/src/db/adapters/web-sql-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export interface ResolvedWebSQLOpenOptions extends SQLOpenOptions {
}

export enum TemporaryStorageOption {
MEMORY = 'memory;',
FILESYSTEM = 'file;'
MEMORY = 'memory',
FILESYSTEM = 'file'
}

/**
Expand All @@ -63,6 +63,7 @@ export interface WebSQLOpenFactoryOptions extends SQLOpenOptions {

/**
* Where to store SQLite temporary files. Defaults to 'MEMORY'.
* Setting this to `FILESYSTEM` can cause issues with larger queries or datasets.
*/
temporaryStorage?: TemporaryStorageOption;
}
Expand Down

0 comments on commit 014138b

Please sign in to comment.