xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_vtab_nochange.3 (revision b9988867a8ad969c45a52aa7628bc932ec98d46b)
1.Dd January 24, 2024
2.Dt SQLITE3_VTAB_NOCHANGE 3
3.Os
4.Sh NAME
5.Nm sqlite3_vtab_nochange
6.Nd determine if virtual table column access is for UPDATE
7.Sh SYNOPSIS
8.In sqlite3.h
9.Ft int
10.Fo sqlite3_vtab_nochange
11.Fa "sqlite3_context*"
12.Fc
13.Sh DESCRIPTION
14If the sqlite3_vtab_nochange(X) routine is called within the xColumn
15method of a virtual table, then it might return true if
16the column is being fetched as part of an UPDATE operation during which
17the column value will not change.
18The virtual table implementation can use this hint as permission to
19substitute a return value that is less expensive to compute and that
20the corresponding xUpdate method understands as a "no-change"
21value.
22.Pp
23If the xColumn method calls sqlite3_vtab_nochange() and finds
24that the column is not changed by the UPDATE statement, then the xColumn
25method can optionally return without setting a result, without calling
26any of the sqlite3_result_xxxxx() interfaces.
27In that case, sqlite3_value_nochange(X) will
28return true for the same column in the xUpdate method.
29.Pp
30The sqlite3_vtab_nochange() routine is an optimization.
31Virtual table implementations should continue to give a correct answer
32even if the sqlite3_vtab_nochange() interface were to always return
33false.
34In the current implementation, the sqlite3_vtab_nochange() interface
35does always returns false for the enhanced UPDATE FROM statement.
36.Sh IMPLEMENTATION NOTES
37These declarations were extracted from the
38interface documentation at line 9828.
39.Bd -literal
40SQLITE_API int sqlite3_vtab_nochange(sqlite3_context*);
41.Ed
42.Sh SEE ALSO
43.Xr sqlite3_result_blob 3
44