Is there any type of interceptor implementation in SQLite?

I want to know, is there a way to intercept DML operations in sqlite? I am looking to implement something like an audit system to extract inserts and updates on the database, and record changes in these events.

I have seen the use of triggers, but this is not enough, because There is no way (I know) to define a global trigger, and manually managing triggers for more than 100 tables does not sound like a good idea… longterm!

I am open to any suggestions, so please fire!

Maybe, this is what you need
SQLite Callback Function for Trace/Logging Query Statements < p>

If you use C/C++ to code your application, you can add a hook to the SQLite API by providing a callback function, which will call the sqlite_trace function to record the query statement.

p>

I want to know, is there a way to intercept DML operations in sqlite? I am looking to implement something like an audit system to extract inserts and updates on the database, and record changes in these events.

I have seen the use of triggers, but this is not enough, because There is no way (I know) to define a global trigger, and manually managing triggers for more than 100 tables does not sound like a good idea… longterm!

I am open to any suggestions, so please fire!

Maybe, this is what you need
SQLite Callback Function for Trace/Logging Query Statements

If you use C/C++ encodes the application, then you can add a hook to the SQLite API by providing a callback function, which will call the sqlite_trace function to record the query statement.

Leave a Comment

Your email address will not be published.