SQLITE3_WAL_AUTOCHECKPOINT(3) Library Functions Manual SQLITE3_WAL_AUTOCHECKPOINT(3)

sqlite3_wal_autocheckpoint — configure an auto-checkpoint

#include <sqlite3.h>

int
sqlite3_wal_autocheckpoint(sqlite3 *db, int N);

The sqlite3_wal_autocheckpoint(D,N) is a wrapper around () that causes any database on database connection D to automatically checkpoint after committing a transaction if there are N or more frames in the write-ahead log file. Passing zero or a negative value as the N parameter disables automatic checkpoints entirely.

The callback registered by this function replaces any existing callback registered using (). Likewise, registering a callback using sqlite3_wal_hook() disables the automatic checkpoint mechanism configured by this function.

The wal_autocheckpoint pragma can be used to invoke this interface from SQL.

Checkpoints initiated by this mechanism are PASSIVE.

Every new database connection defaults to having the auto-checkpoint enabled with a threshold of 1000 or SQLITE_DEFAULT_WAL_AUTOCHECKPOINT pages.

The use of this interface is only necessary if the default setting is found to be suboptimal for a particular application.

These declarations were extracted from the interface documentation at line 10009.

SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N);

sqlite3(3), sqlite3_wal_checkpoint_v2(3), sqlite3_wal_hook(3)

April 29, 2026 NetBSD 11.99