aboutsummaryrefslogtreecommitdiff
path: root/services/docker/mail-server/aws-sendmail/db.ts
diff options
context:
space:
mode:
Diffstat (limited to 'services/docker/mail-server/aws-sendmail/db.ts')
-rw-r--r--services/docker/mail-server/aws-sendmail/db.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/services/docker/mail-server/aws-sendmail/db.ts b/services/docker/mail-server/aws-sendmail/db.ts
index 6a7b100..e239e72 100644
--- a/services/docker/mail-server/aws-sendmail/db.ts
+++ b/services/docker/mail-server/aws-sendmail/db.ts
@@ -72,7 +72,14 @@ export class DbService {
private _migrator;
constructor(public readonly path: string) {
- this._sqlocal = new SQLocalKysely("database.sqlite3");
+ this._sqlocal = new SQLocalKysely({
+ databasePath: path,
+ onInit: (sql) => [
+ // Though this can be executed only once when database is
+ // created, re-calls should not affect performance.
+ sql`PRAGMA journal_mode=WAL;`,
+ ],
+ });
const db = new Kysely<Database>({ dialect: this._sqlocal.dialect });
this._db = db;
this._migrator = new Migrator({