SQLite VDBE opcode

JournalMode

Change the journal mode of database P1 to P3.

An example

1 of the 178 statements we compiled against the sample database use JournalMode. This is the one with the shortest program; the rows that use JournalMode are highlighted.

PRAGMA journal_mode = WAL
addropcodep1p2p3p4p5
0Init0600
1Expire1100
2JournalMode1150
3JournalMode0150
4ResultRow1100
5Halt0000
6Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Expire, Goto, Halt, Init, ResultRow.

What the SQLite documentation says

Change the journal mode of database P1 to P3. P3 must be one of the PAGER_JOURNALMODE_XXX values. If changing between the various rollback modes (delete, truncate, persist, off and memory), this is a simple operation. No IO is required.

If changing into or out of WAL mode the procedure is more complicated.

Write a string containing the final journal-mode to register P2.

From sqlite.org's list of opcodes for SQLite 3.54.1, in the public domain. Opcodes are not a stable interface and change between releases.

← IsType · Jump →