SQLite Forum

Hot backup database in WAL mode by coping
By concatenating and using semicolons like so:

sqlite> PRAGMA wal_checkpoint(TRUNCATE); BEGIN IMMEDIATE;

But as kmedcalf stated, a command from another connection could be executed in between. And I guess that connection could be in the same process from another thread (in serialized mode) or from another process.