Guide · Doing
Watch a table
Watch a table when something else is supposed to be writing to it and you want to see it happen,
such as a worker that should be inserting orders or a migration backfilling a column. The grid
stays where it is and marks what changed since you pressed Watch. If you only want the grid to
reload on a timer, the auto-refresh menu in the data grid does that without
marking anything.
Start a watch
- Right-click
ordersundercommercein the sidebar and chooseWatch. In an open table tab, ⌘⌥W or CtrlAltW does the same, and so doesWatchat the top of the toolbar's auto-refresh menu. - Look at the toolbar. The auto-refresh button is now the watch control: a dot that beats once
per check,
Watching · 1s, the counters+0 ~0 −0andsince 14:22:01.
The tab sorts by id, newest first, so new rows arrive at the top. A table without a numeric key
is sorted by a column named like created_at instead, or keeps its order.
See rows arrive
Write some rows from somewhere else, your app or psql in a terminal.
INSERT INTO commerce.orders (customer_id, store_id, channel, total_cents)
SELECT 40213, id, 'web', 5400
FROM commerce.stores ORDER BY name LIMIT 3;
On the 12-million-row sample the three orders get ids 12000001 to 12000003, with status
at its default, pending. At the next check they appear at the top of the grid, tinted for a few
seconds, each with a + in the gutter. The counters read +3 ~0 −0.
UPDATE commerce.orders SET status = 'paid' WHERE id = 12000001;
DELETE FROM commerce.orders WHERE id = 12000003;
The changed cell shows pending struck through beside paid for about six seconds. Order
12000001 keeps its +, because it is still new since the watch started. A row that existed
before the watch gets a ~. The deleted order leaves the grid, and a strip above it reads −1
with 12000003 struck through. The counters read +3 ~1 −1.
Click the + or ~ in a row's gutter, or press ⌥Enter or AltEnter, to follow that row: a strip of
how long it held each value, and its versions with their times.
The counters read +3 ~1 −1. The third new order is the one in the strip above the grid, which holds what was deleted. The control reads Watching · 1s → 10s here because this connection is production, so the 1 s interval is held to 10 s.
Scrolled down, the rows hold still and a pill counts what arrived: ↑ 3 new.
Watch a whole schema
Right-click commerce, or its Tables folder, and choose Watch tables. A Watch · commerce
tab opens with each table, a checkbox and its own + ~ − counts on the left. Up to 16 tables are
watched at once.
On the right is the write tape, oldest first. Each line is one change: the time to a tenth of a
second, the glyph, the table and key (orders 12000001), then up to three columns of an insert,
status pending → paid for an update, or deleted. Changes split into bursts on a quiet gap of
1.5 s, with quiet 8.2 s between them. On PostgreSQL, rows written by one transaction share a
dot on the spine, tx and its id on hover.
Mark starts a new burst by hand, and Name this burst labels one. Copy as fixtures copies
the new rows as INSERT statements. Click a line to open its table filtered to that row. Writes
Seqora made itself, from the grid or the SQL editor, are marked you.
Stop a watch
Click Watching · 1s for its menu: the interval, Pause, Since now, Pin… and
Stop watching. Since now clears the marks and counts and starts again from the current page.
⌘⌥W or CtrlAltW stops it too, and so does closing the tab.
Pin a watch
Pinned watches are Pro. Choose Pin… in the watch menu or on the tape. The dialog sets which
Changes count (inserted, updated, deleted), an optional Column becomes value such as
status → refunded, a Filter the database applies, such as total_cents > 10000, and
Every 30 s, 1 min, 5 min or 15 min.
A pinned watch keeps checking while Seqora is open, with its tab closed. A check that finds a
match sends one notification and logs the matches, kept for 7 days and at most 10,000 entries.
Pinned watches: <connection> in the command palette opens a Watches · <connection> tab with
each watch, its rule, its last hit and its log. They live on your machine, not on the server,
and stay readable if the license ends.
How it finds changes
Watching polls. Each check sends one probe per connection, asking whether anything was written
since the last one. Only when the answer moves does Seqora fetch the grid's first page again,
the same SELECT the grid runs, and compare it with the last one by primary key. On PostgreSQL
the probe is:
SELECT txid_current_snapshot()::text;
| Engine | The probe |
|---|---|
| PostgreSQL | txid_current_snapshot(), which moves when any transaction on the server writes |
| MySQL, MariaDB | SHOW GLOBAL STATUS for the Innodb_rows_inserted, _updated and _deleted counters |
| SQLite | the size and modified time of the database file and its -wal file |
| SQL Server | none, so every check fetches the page |
A quiet table costs one probe per check, plus one fetch every 15 s in case the probe missed
something. The interval never drops below ten times the last fetch time: a page that takes
400 ms is checked every 4 s at most. A connection named like production (Prod, prod-eu) is
checked every 10 s at most. One check runs at a time per connection.
Caveats
- A table needs a primary key or a unique key. Without one, the toolbar's
Watchis disabled and says "This table has no primary key or unique key, so changes can’t be matched to rows." - Only the first page is compared. Inserts show because new rows sort to the top. On a large table, updates and deletes are seen only for rows on that page. The tape compares 100 rows per table, a pinned watch 200.
- A filter limits the watch to the rows it keeps. Changing the filter or the sort starts a new comparison without marking anything. Sorted by another column, a new row is marked only if it lands on the first page.
- The watch holds while you have unsaved edits and while more than one page is loaded. The dot turns hollow and its tooltip says why. A pane that is out of sight doesn't check either.
- If the connection drops, the watch holds with
Not connectedand checks nothing until it is back. After a failed check, it waits four times its interval before the next one. - A row inserted and deleted between two checks never appears. On MySQL and MariaDB the counters can move before the commit, so a row committed late can wait for the 15 s fetch.
- Grid and tape watches stop while Seqora's window is hidden. Pinned watches keep going. Nothing runs while Seqora is closed.