Name

sqlite3_trace() — Register an SQL statement trace callback [EXP]

Definition

void* sqlite3_trace( sqlite3* db, trace_callback, void* udp);

void trace_callback( void* udp, const char* sql );
db

A database connection.

trace_callback

An application-defined trace callback function.

udp

An application-defined user-data pointer. This value is made available to the trace function.

sql

The text of the SQL statement that was executed, encoded in UTF-8.

Returns (sqlite3_trace())

The previous user-data pointer, if applicable.

Description

This function allows an application to register a trace function. The callback is called just before any SQL statement is processed. It may also be called when additional statements are processed, such as trigger bodies.

If the SQL text contains any statement parameters, these will be replaced with the actual values used for this execution.

See Also

sqlite3_profile()