From 63847496f14c813a5d80efd5b7de0f1294ffe1e3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 16:07:11 +0200 Subject: Adding upstream version 3.45.1. Signed-off-by: Daniel Baumann --- www/c3ref/wal_hook.html | 165 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 www/c3ref/wal_hook.html (limited to 'www/c3ref/wal_hook.html') diff --git a/www/c3ref/wal_hook.html b/www/c3ref/wal_hook.html new file mode 100644 index 0000000..44c3827 --- /dev/null +++ b/www/c3ref/wal_hook.html @@ -0,0 +1,165 @@ + + + + + +Write-Ahead Log Commit Hook + + + +
+ + + +
+
+Small. Fast. Reliable.
Choose any three. +
+ + +
+
+ + + +
+
+
+ + +
+

SQLite C Interface

+

Write-Ahead Log Commit Hook

+
+
+void *sqlite3_wal_hook(
+  sqlite3*,
+  int(*)(void *,sqlite3*,const char*,int),
+  void*
+);
+
+

+The sqlite3_wal_hook() function is used to register a callback that +is invoked each time data is committed to a database in wal mode.

+ +

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.

+ +

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.

+ +

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.

+ +

A single database handle may have at most a single write-ahead log callback +registered at one time. Calling 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 sqlite3_wal_autocheckpoint() interface and the +wal_autocheckpoint pragma both invoke sqlite3_wal_hook() and will +overwrite any prior sqlite3_wal_hook() settings. +

See also lists of + Objects, + Constants, and + Functions.

+ -- cgit v1.2.3