xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_wal_autocheckpoint.3 (revision bdc22b2e01993381dcefeff2bc9b56ca75a4235c)
1.Dd March 11, 2017
2.Dt SQLITE3_WAL_AUTOCHECKPOINT 3
3.Os
4.Sh NAME
5.Nm sqlite3_wal_autocheckpoint
6.Nd Configure an auto-checkpoint
7.Sh SYNOPSIS
8.Ft int
9.Fo sqlite3_wal_autocheckpoint
10.Fa "sqlite3 *db"
11.Fa "int N"
12.Fc
13.Sh DESCRIPTION
14The sqlite3_wal_autocheckpoint(D,N)
15is a wrapper around sqlite3_wal_hook() that causes
16any database on database connection D to automatically
17checkpoint after committing a transaction if there are N
18or more frames in the write-ahead log file.
19Passing zero or a negative value as the nFrame parameter disables automatic
20checkpoints entirely.
21.Pp
22The callback registered by this function replaces any existing callback
23registered using sqlite3_wal_hook().
24Likewise, registering a callback using sqlite3_wal_hook()
25disables the automatic checkpoint mechanism configured by this function.
26.Pp
27The wal_autocheckpoint pragma can be used
28to invoke this interface from SQL.
29.Pp
30Checkpoints initiated by this mechanism are PASSIVE.
31.Pp
32Every new database connection defaults to having
33the auto-checkpoint enabled with a threshold of 1000 or SQLITE_DEFAULT_WAL_AUTOCHECKPOINT
34pages.
35The use of this interface is only necessary if the default setting
36is found to be suboptimal for a particular application.
37.Sh SEE ALSO
38.Xr sqlite3 3 ,
39.Xr sqlite3_wal_checkpoint_v2 3 ,
40.Xr sqlite3_wal_hook 3
41