Skip to content

Commit f3bec8c

Browse files
committed
Add test that checks that correct journal_mode is used.
1 parent 9c933ed commit f3bec8c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/tests/sqlite/rawQueries.spec.ts

+20
Original file line numberDiff line numberDiff line change
@@ -629,5 +629,25 @@ export function registerBaseTests() {
629629

630630
expect(duration).lessThan(2000);
631631
});
632+
633+
it('Should use WAL', async () => {
634+
for (let i = 0; i < 5; i++) {
635+
let db: QuickSQLiteConnection;
636+
try {
637+
db = open('test-wal' + i, {
638+
numReadConnections: NUM_READ_CONNECTIONS
639+
});
640+
641+
const journalMode = await db.execute('PRAGMA journal_mode');
642+
const journalModeRO = await db.readLock((tx) => tx.execute('PRAGMA journal_mode'));
643+
expect(journalMode.rows.item(0).journal_mode).equals('wal');
644+
645+
expect(journalModeRO.rows.item(0).journal_mode).equals('wal');
646+
} finally {
647+
db?.close();
648+
db?.delete();
649+
}
650+
}
651+
});
632652
});
633653
}

0 commit comments

Comments
 (0)