Name
sqlite3_set_auxdata() — Set auxiliary data on a function parameter
Definition
void sqlite3_set_auxdata( sqlite3_context* ctx, int pidx,
void* data, mem_callback );
void mem_callback( void* ptr );-
ctx An SQL function context, provided by the SQLite library.
-
pidx The parameter index.
-
data The auxiliary data value.
-
mem_callback A function pointer to a memory deallocation function. This function frees the memory buffer used to hold the value. If the buffer was allocated with
sqlite3_malloc(), a reference tosqlite3_free()can be passed directly.The flags
SQLITE_STATICandSQLITE_TRANSIENT(which are used bysqlite3_bind_xxx()andsqlite3_result_xxx()) are not available in this context.
Description
This function allows an SQL function implementation to attach auxiliary data to specific SQL function parameters. In situations where an SQL statement calls the same function repeatedly with the same parameter values, the auxiliary data will be preserved across calls. This allows a function implementation to cache high-cost value, such as a compiled regular expression.
For more details on how to use auxiliary data, see http://www.sqlite.org/c3ref/get_auxdata.html.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access