From 1bf10805766871dccc5a5fab5fc0559518aa8dba Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Tue, 12 Dec 2023 10:03:24 +0500 Subject: [PATCH] web: allow core to specify custom sql db name --- apps/web/src/common/db.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/common/db.ts b/apps/web/src/common/db.ts index 1ecf6d8c9..e0342a5c4 100644 --- a/apps/web/src/common/db.ts +++ b/apps/web/src/common/db.ts @@ -57,13 +57,13 @@ async function initializeDatabase(persistence: DatabasePersistence) { database.setup({ sqliteOptions: { - dialect: { + dialect: (name) => ({ createDriver: () => - new WaSqliteWorkerDriver({ async: true, dbName: "test.db" }), + new WaSqliteWorkerDriver({ async: true, dbName: name }), createAdapter: () => new SqliteAdapter(), createIntrospector: (db) => new SqliteIntrospector(db), createQueryCompiler: () => new SqliteQueryCompiler() - }, + }), journalMode: "MEMORY", synchronous: "normal", pageSize: 8192,