Merge WAL contents back into the main database file.

Section: WAL mode and lock handling

Run a WAL checkpoint

sql
sql
PRAGMA wal_checkpoint(TRUNCATE);
Explanation

Useful in maintenance jobs or after heavy write bursts when you want to reclaim WAL size.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing WAL mode and lock handling
Enable WAL journaling
Switch the database to write-ahead logging mode.
OpenIn sheetsqlsame section
Set a busy timeout
Wait briefly when the database is locked.
OpenIn sheetsqlsame section
Inspect locking mode
See or set the database locking mode.
OpenIn sheetsqlsame section
Start a transaction
Bundle multiple statements atomically.
OpenIn sheetsql1 tag match
Begin an IMMEDIATE transaction
Reserve the write lock up front.
OpenIn sheetsql1 tag match
Roll back a transaction
Undo uncommitted changes.
OpenIn sheetsql1 tag match