Adding user logs for database changes?

Hello,
I have recently stumbled upon Retool and tried building an app that can provide our back-office with the ability to change/delete records from our client database.
While making the app I realized that we need to know who made changes to the database and after searching I didn't see a feature like that.

Is there any way of adding a logger that will save the changes that users make in the app? I want to specify, I am talking about changing info in the database not editing the app.
Thanks,

It depends on the db type you are using... I have used triggers and functions (Postgres) to capture when a record is created, updated or "deleted" (marked as deleted but not removed from the db)

1 Like

There's either Audit Logs, or if you're not on one of the plans that supports this, you could (for sensitive stuff), chain two queries per-operation (messy, but functional).
e.g.

  1. On click -> run deleteEntryLog
  2. deleteEntryLog: add row to database log with value (entry) -> on success (in query settings) run deleteEntry
  3. deleteEntry: delete entry (entry)

Makes sense?

2 Likes

Yes, I'll try it out.

Thanks!