SQLite Forum

How to Record all Transactions

How to Record all Transactions

(1) By anonymous on 2021-04-19 13:34:58 [link] [source]

Hi, newbie to SQLite and I am amazed! What a fantastic product, well done Dr. Hipp.

I'm looking to record all SQL commands that are issued to my database. These will be SELECTs, INSERTs, and UPDATEs. (I won't be deleting rows.)

How can I record all of these statements?

  • Can I set up a TRIGGER? (I tried and couldn't vision how that would work.)
  • Do I need to create a new TABLE and save the S/I/U queries to this new TABLE?
  • Some other way that I hadn't thought of?

(2) By Stephan Beal (stephan) on 2021-04-19 13:38:35 in reply to 1 [source]

How can I record all of these statements?


(4) By MichaelS on 2021-04-19 14:24:49 in reply to 2 [link] [source]

Thank you. That's what I thought it might be. I will have to spend time of this page and search for examples.

Fwiw, I registered b/c I reckon I'll be spending much more time with this great product. (I am the anonymous OP.)

(3) By ddevienne on 2021-04-19 14:22:59 in reply to 1 [link] [source]

Beside tracing, SQLite has various hooks (update, commit, pre-update),
and also an authorizer API, all giving information about what's going on,
which could be useful, depending on what you are trying to do exactly.

(5) By MichaelS on 2021-04-19 14:25:47 in reply to 3 [link] [source]

Ok, thank you.

I am using sqlite in a PHP app running on a shared host. I will have to research how to do this.