diff --git a/src/driver/capacitor/CapacitorDriver.ts b/src/driver/capacitor/CapacitorDriver.ts index 1e394e27c5..ee0288df98 100644 --- a/src/driver/capacitor/CapacitorDriver.ts +++ b/src/driver/capacitor/CapacitorDriver.ts @@ -86,10 +86,15 @@ export class CapacitorDriver extends AbstractSqliteDriver { // working properly. this also makes onDelete to work with sqlite. await connection.query(`PRAGMA foreign_keys = ON`, []); - if (this.options.journalMode) { - await connection.query(`PRAGMA journal_mode = ?`, [ - this.options.journalMode, - ]); + if ( + this.options.journalMode && + ["DELETE", "TRUNCATE", "PERSIST", "MEMORY", "WAL", "OFF"].indexOf( + this.options.journalMode + ) !== -1 + ) { + await connection.query( + `PRAGMA journal_mode = ${this.options.journalMode}` + ); } return connection;