From 5895b3dd6e1b953c80d122cd82056272cb316437 Mon Sep 17 00:00:00 2001 From: Isaac Date: Sat, 17 Jun 2023 17:01:06 +0100 Subject: [PATCH] perf(sqlite): synchronous=normal --- src/client.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client.js b/src/client.js index 0b2567d..23834a2 100644 --- a/src/client.js +++ b/src/client.js @@ -55,9 +55,10 @@ module.exports = class Client extends FrameworkClient { this.prisma = new PrismaClient(); if (process.env.DB_PROVIDER === 'sqlite') { this.prisma.$use(sqliteMiddleware); - // make sqlite faster (https://www.sqlite.org/wal.html), + // make sqlite faster, // and the missing parentheses are not a mistake, `$queryRaw` is a tagged template literal - this.log.debug(await this.prisma.$queryRaw`PRAGMA journal_mode=WAL;`); + this.log.debug(await this.prisma.$queryRaw`PRAGMA journal_mode=WAL;`); // https://www.sqlite.org/wal.html + this.log.debug(await this.prisma.$queryRaw`PRAGMA synchronous=normal;`); // https://www.sqlite.org/pragma.html#pragma_synchronous } this.keyv = new Keyv(); return super.login(token);