Name

sqlite3_profile() — Register an SQL statement profile callback

Definition

void* sqlite3_profile( sqlite3* db, profile_func, void* udp );

void profile_func( void* udp, const char* sql, sqlite3_uint64 time );
db

A database connection.

profile_func

An application-defined profile callback function.

udp

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

sql

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

time

The wall-clock time required to execute the statement, in nanoseconds. Most system clocks cannot actually provide nanosecond precision.

Returns (sqlite3_profile())

The udp parameter of any prior profile function. If no prior profile function was registered, a NULL will be returned.

Description

This function allows an application to register a profiling function. The callback function is called every time a call to sqlite3_step() finishes. Only one profile function is allowed. Registering a new function will override the old function. To unregister a profiling function, pass in a NULL function pointer.

Get Using SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.