Skip to content

Commit

Permalink
perf(sqlite): synchronous=normal
Browse files Browse the repository at this point in the history
  • Loading branch information
eartharoid committed Jun 17, 2023
1 parent d77d37c commit 5895b3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5895b3d

Please sign in to comment.