Database Table Editor

September 17th, 2025


DB table editor

Why isn’t there a terminal editor for database tables? In development, I often want to check the database without repetitively SELECT or a quick change without typing a full UPDATE.

What’s the challenge? My time at Numeracy tells me it’s always caching. Your database client should always have up-to-date data. There’s no consistent way to detect changes on a table across databases without modifying the database (streaming changes over). Yet, a database client should not require anything more than read permissions.

The only answer is caching and polling. However, the bigger the cache, the bigger the caching problem. Get only what’s need for display. Of course, this means you need to sort, as databases don’t have a default sorting mechanism.1 That means we need some kind of stable lookup key; preferably primary key but optionally a non-nullable or nulls not distinct unique constraint. The use case is here administrative and not analytical.2

It’s a sliding window into the database. As such, it is always ordered by primary key. select * from t where id > $1 order by id limit $2

If you add ORDER BY created, there is a hidden order by created, x. You can add WHERE clauses. They are executed as WHERE (user-where-clause) AND id > ? when paging.

ted --pg blog posts --where tags=tech

Polling every 200ms, ideally visually indicating changes, especially since you’re only getting a few hundred rows. You’d want visual indicators for 🟩 inserted, 🟥 deleted, and 🟧 updated rows.

You also may not want to overwrite changes. When saving a value to database, UPDATE posts SET title = $1 WHERE id = $2 AND title = $3. If no row is updated, pop a confirmation dialogue to overwrite.

  1. Postgres has cursors, but that’s not common. Limit offsets don’t work if the table underneath you is modified. 

  2. Tables without any primary keys are event logs and are probably better tailed than edited.