看看sqlite
Trace API。你必须自己实现回调。
void *sqlite3_trace(sqlite3*,void(*xTrace)(void*,const char*),void*);
The callback function registered by
sqlite3_trace()
is invoked at varIoUs times when an sql statement is being run bysqlite3_step()
. The callback returns a UTF-8 rendering of the sql statement text as the statement first begins executing. Additional callbacks occur as each triggered subprogram is entered.