SQL query logging for SQLite?

前端 未结 1 1195
梦谈多话
梦谈多话 2020-12-08 20:04

I need to log queries, not only inserts/updates/deletes but also selects and other queries, from a number of applications that use SQLite. Introducing logging to the applica

相关标签:
1条回答
  • 2020-12-08 20:41

    Take a look at the sqlite Trace API. You have to implement the callback yourself.

    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 by sqlite3_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.

    0 讨论(0)
提交回复
热议问题