diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 19:55:15 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 19:55:15 -0400 |
| commit | 253e67c8b3a72b3a4757fdbc5845297628db0a4a (patch) | |
| tree | adf53b66087aa30dfbf8bf391a1dadb044c3bf4d /static/netbsd/man3/sqlite3_wal_hook.3 | |
| parent | a9157ce950dfe2fc30795d43b9d79b9d1bffc48b (diff) | |
docs: Added All NetBSD Manuals
Diffstat (limited to 'static/netbsd/man3/sqlite3_wal_hook.3')
| -rw-r--r-- | static/netbsd/man3/sqlite3_wal_hook.3 | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/static/netbsd/man3/sqlite3_wal_hook.3 b/static/netbsd/man3/sqlite3_wal_hook.3 new file mode 100644 index 00000000..5b3a4e50 --- /dev/null +++ b/static/netbsd/man3/sqlite3_wal_hook.3 @@ -0,0 +1,69 @@ +.Dd January 24, 2024 +.Dt SQLITE3_WAL_HOOK 3 +.Os +.Sh NAME +.Nm sqlite3_wal_hook +.Nd write-Ahead log commit hook +.Sh SYNOPSIS +.In sqlite3.h +.Ft void * +.Fo sqlite3_wal_hook +.Fa "sqlite3*" +.Fa "int(*)(void *,sqlite3*,const char*,int)" +.Fa "void*" +.Fc +.Sh DESCRIPTION +The +.Fn sqlite3_wal_hook +function is used to register a callback that is invoked each time data +is committed to a database in wal mode. +.Pp +The callback is invoked by SQLite after the commit has taken place +and the associated write-lock on the database released, so the implementation +may read, write or checkpoint the database as required. +.Pp +The first parameter passed to the callback function when it is invoked +is a copy of the third parameter passed to sqlite3_wal_hook() when +registering the callback. +The second is a copy of the database handle. +The third parameter is the name of the database that was written to +- either "main" or the name of an ATTACH-ed database. +The fourth parameter is the number of pages currently in the write-ahead +log file, including those that were just committed. +.Pp +The callback function should normally return SQLITE_OK. +If an error code is returned, that error will propagate back up through +the SQLite code base to cause the statement that provoked the callback +to report an error, though the commit will have still occurred. +If the callback returns SQLITE_ROW or SQLITE_DONE, +or if it returns a value that does not correspond to any valid SQLite +error code, the results are undefined. +.Pp +A single database handle may have at most a single write-ahead log +callback registered at one time. +Calling +.Fn sqlite3_wal_hook +replaces any previously registered write-ahead log callback. +The return value is a copy of the third parameter from the previous +call, if any, or 0. +Note that the +.Fn sqlite3_wal_autocheckpoint +interface and the wal_autocheckpoint pragma +both invoke +.Fn sqlite3_wal_hook +and will overwrite any prior +.Fn sqlite3_wal_hook +settings. +.Sh IMPLEMENTATION NOTES +These declarations were extracted from the +interface documentation at line 9512. +.Bd -literal +SQLITE_API void *sqlite3_wal_hook( + sqlite3*, + int(*)(void *,sqlite3*,const char*,int), + void* +); +.Ed +.Sh SEE ALSO +.Xr sqlite3_wal_autocheckpoint 3 , +.Xr SQLITE_OK 3 |
