Live database activity: watch inserts, updates and deletes as they happen
Describes Database Explorer 0.4.0.
The Activity page of the DB explorer is a live feed of changes to your database tables: every row added, changed or deleted, with the row’s values and the fields that changed.
Where to find it
In the admin sidebar, open DB, then Activity, or go to /admin/db/activity. The Live Activity button on the DB overview and on any table’s page opens it too; from a table’s page it comes already filtered to that table.
Like the rest of the explorer, it needs the DB module switched on under Admin › Modules and the DB permission (Owner and Admin have it).
Which tables it shows
The feed only covers tables that have been opened in the explorer at least once. A table nobody has opened is not watched, so its changes never appear. To start watching a table, open its page from the DB overview.
The feed starts empty each time you open the page. It shows what happens while the page is open, not past changes. While nothing has happened yet, it says Waiting for database activity….
Live activity: changes as they happen.
Reading an event
Each event shows:
- A badge with the operation: INSERT, UPDATE or DELETE.
- The table as
schema.table. Click it to open the table. - id: and the row’s id, when the table has one.
- The date and time it happened.
- The row’s fields and values, in alphabetical order, as the row is now. Long values and JSON fold up; click them to open.
The badges compare a row with the previous event for the same row in this feed. On an INSERT every field is marked new. On a later UPDATE of that row, changed marks a field whose value differs and new marks one that was empty before. An UPDATE of a row the feed hasn’t seen yet has no badges, because there is nothing to compare it with.
When the row can’t be shown, the event says Row deleted (data not available) for a delete, or Row data not available otherwise, with (table may not have an ‘id’ column) when there was no id to look it up by.
Secret-looking fields (passwords, tokens and the like) are masked here the same way as on the table pages.
Controls
- Pause stops adding events. The dot in the header turns yellow and the subtitle says how many events the feed holds. Events that happen while paused are not kept. Resume starts again.
- Clear empties the feed on this page. It doesn’t touch the database.
- Table: show only events from one table, or All tables.
- Operation: show only INSERT, UPDATE or DELETE, or All.
- The count on the right says how many events the feed holds.
The filters apply to events that arrive after you change them. Events already in the feed stay.
The feed keeps the latest 100 events. When changes arrive faster than the page can show them, some are left out, and a yellow box says how many were skipped.
What it doesn’t do
- It doesn’t show changes to tables nobody has opened in the explorer.
- It doesn’t keep a history: closing or reloading the page loses the feed.
- It doesn’t undo changes or let you edit rows.