/ Check-in [7f857020]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update the documentation comment in sqlite.h.in for sqlite3_preupdate_hook().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7f8570208c06c056d426e9299d9930181a0464f8
User & Date: dan 2017-02-01 14:19:43
Context
2017-02-01
15:19
Fix the build by making the OPFLAG_ISNOOP macro available unconditionally. check-in: 510933cb user: drh tags: trunk
14:19
Update the documentation comment in sqlite.h.in for sqlite3_preupdate_hook(). check-in: 7f857020 user: dan tags: trunk
14:10
Changes so that the pre-update hook and the sessions module work with WITHOUT ROWID tables. check-in: 964bdc27 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqlite.h.in.

  8176   8176   ** CAPI3REF: The pre-update hook.
  8177   8177   **
  8178   8178   ** ^These interfaces are only available if SQLite is compiled using the
  8179   8179   ** [SQLITE_ENABLE_PREUPDATE_HOOK] compile-time option.
  8180   8180   **
  8181   8181   ** ^The [sqlite3_preupdate_hook()] interface registers a callback function
  8182   8182   ** that is invoked prior to each [INSERT], [UPDATE], and [DELETE] operation
  8183         -** on a [rowid table].
         8183  +** on a database table.
  8184   8184   ** ^At most one preupdate hook may be registered at a time on a single
  8185   8185   ** [database connection]; each call to [sqlite3_preupdate_hook()] overrides
  8186   8186   ** the previous setting.
  8187   8187   ** ^The preupdate hook is disabled by invoking [sqlite3_preupdate_hook()]
  8188   8188   ** with a NULL pointer as the second parameter.
  8189   8189   ** ^The third parameter to [sqlite3_preupdate_hook()] is passed through as
  8190   8190   ** the first parameter to callbacks.
  8191   8191   **
  8192         -** ^The preupdate hook only fires for changes to [rowid tables]; the preupdate
  8193         -** hook is not invoked for changes to [virtual tables] or [WITHOUT ROWID]
  8194         -** tables.
         8192  +** ^The preupdate hook only fires for changes to real database tables; the
         8193  +** preupdate hook is not invoked for changes to [virtual tables] or to
         8194  +** system tables like sqlite_master or sqlite_stat1.
  8195   8195   **
  8196   8196   ** ^The second parameter to the preupdate callback is a pointer to
  8197   8197   ** the [database connection] that registered the preupdate hook.
  8198   8198   ** ^The third parameter to the preupdate callback is one of the constants
  8199   8199   ** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to identify the
  8200   8200   ** kind of update operation that is about to occur.
  8201   8201   ** ^(The fourth parameter to the preupdate callback is the name of the
  8202   8202   ** database within the database connection that is being modified.  This
  8203   8203   ** will be "main" for the main database or "temp" for TEMP tables or 
  8204   8204   ** the name given after the AS keyword in the [ATTACH] statement for attached
  8205   8205   ** databases.)^
  8206   8206   ** ^The fifth parameter to the preupdate callback is the name of the
  8207   8207   ** table that is being modified.
  8208         -** ^The sixth parameter to the preupdate callback is the initial [rowid] of the
  8209         -** row being changes for SQLITE_UPDATE and SQLITE_DELETE changes and is
  8210         -** undefined for SQLITE_INSERT changes.
  8211         -** ^The seventh parameter to the preupdate callback is the final [rowid] of
  8212         -** the row being changed for SQLITE_UPDATE and SQLITE_INSERT changes and is
  8213         -** undefined for SQLITE_DELETE changes.
         8208  +**
         8209  +** For an UPDATE or DELETE operation on a [rowid table], the sixth
         8210  +** parameter passed to the preupdate callback is the initial [rowid] of the 
         8211  +** row being modified or deleted. For an INSERT operation on a rowid table,
         8212  +** or any operation on a WITHOUT ROWID table, the value of the sixth 
         8213  +** parameter is undefined. For an INSERT or UPDATE on a rowid table the
         8214  +** seventh parameter is the final rowid value of the row being inserted
         8215  +** or updated. The value of the seventh parameter passed to the callback
         8216  +** function is not defined for operations on WITHOUT ROWID tables, or for
         8217  +** INSERT operations on rowid tables.
  8214   8218   **
  8215   8219   ** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()],
  8216   8220   ** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces
  8217   8221   ** provide additional information about a preupdate event. These routines
  8218   8222   ** may only be called from within a preupdate callback.  Invoking any of
  8219   8223   ** these routines from outside of a preupdate callback or with a
  8220   8224   ** [database connection] pointer that is different from the one supplied