1.Dd March 11, 2017 2.Dt SQLITE3_TRACE_V2 3 3.Os 4.Sh NAME 5.Nm sqlite3_trace_v2 6.Nd SQL Trace Hook 7.Sh SYNOPSIS 8.Ft int 9.Fo sqlite3_trace_v2 10.Fa "sqlite3*" 11.Fa "unsigned uMask" 12.Fa "int(*xCallback)(unsigned,void*,void*,void*)" 13.Fa "void *pCtx " 14.Fc 15.Sh DESCRIPTION 16The sqlite3_trace_v2(D,M,X,P) interface registers a trace callback 17function X against database connection D, using 18property mask M and context pointer P. 19If the X callback is NULL or if the M mask is zero, then tracing is 20disabled. 21The M argument should be the bitwise OR-ed combination of zero or more 22SQLITE_TRACE constants. 23.Pp 24Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides 25(cancels) any prior calls to sqlite3_trace() or sqlite3_trace_v2(). 26.Pp 27The X callback is invoked whenever any of the events identified by 28mask M occur. 29The integer return value from the callback is currently ignored, though 30this may change in future releases. 31Callback implementations should return zero to ensure future compatibility. 32.Pp 33A trace callback is invoked with four arguments: callback(T,C,P,X). 34The T argument is one of the SQLITE_TRACE constants to 35indicate why the callback was invoked. 36The C argument is a copy of the context pointer. 37The P and X arguments are pointers whose meanings depend on T. 38.Pp 39The sqlite3_trace_v2() interface is intended to replace the legacy 40interfaces sqlite3_trace() and sqlite3_profile(), 41both of which are deprecated. 42.Sh SEE ALSO 43.Xr sqlite3 3 , 44.Xr sqlite3_trace 3 , 45.Xr SQLITE_TRACE_STMT 3 46