Section: WAL mode and lock handling

Set a busy timeout

sql
sql
PRAGMA busy_timeout = 5000;
Explanation

A practical first-line defense against transient `database is locked` failures.

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
Run a WAL checkpoint
Merge WAL contents back into the main database file.
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