From 18657a960e125336f704ea058e25c27bd3900dcb Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 19:28:19 +0200 Subject: Adding upstream version 3.40.1. Signed-off-by: Daniel Baumann --- www/c3ref/update_hook.html | 179 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 www/c3ref/update_hook.html (limited to 'www/c3ref/update_hook.html') diff --git a/www/c3ref/update_hook.html b/www/c3ref/update_hook.html new file mode 100644 index 0000000..afed2fa --- /dev/null +++ b/www/c3ref/update_hook.html @@ -0,0 +1,179 @@ + + + + + +Data Change Notification Callbacks + + + +
+ + + +
+
+Small. Fast. Reliable.
Choose any three. +
+ + +
+
+ + + +
+
+
+ + +
+

SQLite C Interface

+

Data Change Notification Callbacks

+
+
+void *sqlite3_update_hook(
+  sqlite3*,
+  void(*)(void *,int ,char const *,char const *,sqlite3_int64),
+  void*
+);
+
+

+The sqlite3_update_hook() interface registers a callback function +with the database connection identified by the first argument +to be invoked whenever a row is updated, inserted or deleted in +a rowid table. +Any callback set by a previous call to this function +for the same database connection is overridden.

+ +

The second argument is a pointer to the function to invoke when a +row is updated, inserted or deleted in a rowid table. +The first argument to the callback is a copy of the third argument +to sqlite3_update_hook(). +The second callback argument is one of SQLITE_INSERT, SQLITE_DELETE, +or SQLITE_UPDATE, depending on the operation that caused the callback +to be invoked. +The third and fourth arguments to the callback contain pointers to the +database and table name containing the affected row. +The final callback parameter is the rowid of the row. +In the case of an update, this is the rowid after the update takes place.

+ +

The update hook is not invoked when internal system tables are +modified (i.e. sqlite_sequence). +The update hook is not invoked when WITHOUT ROWID tables are modified.

+ +

In the current implementation, the update hook +is not invoked when conflicting rows are deleted because of an +ON CONFLICT REPLACE clause. Nor is the update hook +invoked when rows are deleted using the truncate optimization. +The exceptions defined in this paragraph might change in a future +release of SQLite.

+ +

The update hook implementation must not do anything that will modify +the database connection that invoked the update hook. Any actions +to modify the database connection must be deferred until after the +completion of the sqlite3_step() call that triggered the update hook. +Note that sqlite3_prepare_v2() and sqlite3_step() both modify their +database connections for the meaning of "modify" in this paragraph.

+ +

The sqlite3_update_hook(D,C,P) function +returns the P argument from the previous call +on the same database connection D, or NULL for +the first call on D.

+ +

See also the sqlite3_commit_hook(), sqlite3_rollback_hook(), +and sqlite3_preupdate_hook() interfaces. +

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

+ -- cgit v1.2.3