summaryrefslogtreecommitdiff
path: root/static/netbsd/man3/sqlite3_update_hook.3
diff options
context:
space:
mode:
Diffstat (limited to 'static/netbsd/man3/sqlite3_update_hook.3')
-rw-r--r--static/netbsd/man3/sqlite3_update_hook.387
1 files changed, 87 insertions, 0 deletions
diff --git a/static/netbsd/man3/sqlite3_update_hook.3 b/static/netbsd/man3/sqlite3_update_hook.3
new file mode 100644
index 00000000..e330a853
--- /dev/null
+++ b/static/netbsd/man3/sqlite3_update_hook.3
@@ -0,0 +1,87 @@
+.Dd January 24, 2024
+.Dt SQLITE3_UPDATE_HOOK 3
+.Os
+.Sh NAME
+.Nm sqlite3_update_hook
+.Nd data change notification callbacks
+.Sh SYNOPSIS
+.In sqlite3.h
+.Ft void *
+.Fo sqlite3_update_hook
+.Fa "sqlite3*"
+.Fa "void(*)(void *,int ,char const *,char const *,sqlite3_int64)"
+.Fa "void*"
+.Fc
+.Sh DESCRIPTION
+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.
+.Pp
+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.
+.Pp
+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.
+.Pp
+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.
+.Pp
+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
+.Fn sqlite3_step
+call that triggered the update hook.
+Note that
+.Fn sqlite3_prepare_v2
+and
+.Fn sqlite3_step
+both modify their database connections for the meaning of "modify"
+in this paragraph.
+.Pp
+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.
+.Pp
+See also the
+.Fn sqlite3_commit_hook ,
+.Fn sqlite3_rollback_hook ,
+and
+.Fn sqlite3_preupdate_hook
+interfaces.
+.Sh IMPLEMENTATION NOTES
+These declarations were extracted from the
+interface documentation at line 6838.
+.Bd -literal
+SQLITE_API void *sqlite3_update_hook(
+ sqlite3*,
+ void(*)(void *,int ,char const *,char const *,sqlite3_int64),
+ void*
+);
+.Ed
+.Sh SEE ALSO
+.Xr sqlite3 3 ,
+.Xr sqlite3_commit_hook 3 ,
+.Xr sqlite3_prepare 3 ,
+.Xr sqlite3_preupdate_hook 3 ,
+.Xr sqlite3_step 3 ,
+.Xr SQLITE_CREATE_INDEX 3