Why I made my SQL client show "how many rows" before every UPDATE

2026-12-05来源 dev.toEnglish
Why I made my SQL client show "how many rows" before every UPDATE

Heads-up first

  • This article was written by AI (Claude); I reviewed it and published it.
  • The app, VeqSQL, is an experiment toward AI-driven development. I decide the specs and the design; AI does most of the implementation and testing.

I'm building a SQL client called VeqSQL. The idea is simple: it stops you before you run something you can't undo. This post explains what "stopping" means in practice.

The mistake I want to prevent

UPDATE orders SET status = 'Shipped'; 

That's an UPDATE with the WHERE forgotten. Even if you notice the instant you press Run, every row has already been rewritten.

A condition that is slightly too broad. Being connected to the wrong environment. Same story. Noticing after you run it is too late.

Before running, it shows three things

Before an UPDATE or DELETE runs, VeqSQL pauses and shows:

  1. Which rows are affected (the values before the change)
  2. What they will look like after (the expected result)
  3. How many rows

You have to type the row count

A plain "OK" button isn't enough. You can't run the statement until you type the number of affected rows yourself.

A "Confirm" button can be clicked without reading. To type the number, you have to look at it. If you expected 1 row and the dialog says 5,000, you notice right there.

An UPDATE or DELETE without a WHERE clause can't be run at all. For DROP and TRUNCATE, you type the object's name instead of a count.

Running it doesn't commit it

After it runs, the change stays uncommitted. You look at the result, then choose commit or rollback yourself.

If the target rows changed between the confirmation and the execution, or the affected count differs from the count you approved, the whole thing is rolled back.

If it can't be verified, it says so

Some writes can't be counted beforehand, such as stored procedures. In that case VeqSQL doesn't pretend. It shows "impact can't be verified" and asks for your explicit approval.

What it can't do yet

I'd rather be upfront:

  • INSERT is not covered by the pre-run confirmation yet.
  • The side-by-side "compare run" (before/after) only runs when you tick it. It isn't enforced.
  • The UI is still being polished. Some parts are still confusing.

These are on my list.

Try it

VeqSQL is a preview release (the Windows installer is unsigned, so your OS may warn you). It's built with Rust and Tauri.

brew tap to-yamauchi/tap brew trust --cask to-yamauchi/tap/veqsql-free brew install --cask to-yamauchi/tap/veqsql-free 

There's also a test database with fake data, so you can try the confirmation without touching real data: https://veqsql.net/testenv.html

If something is unclear, or there's a moment where you'd want it to stop you, I'd love to hear it in the comments.

原文:https://www.a8q9.cn/en/article/why-i-made-my-sql-client-show-how-many-rows-before-every-update-7d6e0c.html

相关文章