SQL review: the check that runs before the reviewer (3/7)
SQL review, before the reviewer (3/7)
Every team has someone who knows that this particular ALTER will lock the table for twenty minutes. SQL review is that knowledge written down once — so it runs at 2am too, on the change no one is watching. The rules are what a careful DBA would say out loud:
Require WHERE
Catches a forgotten WHERE on an UPDATE or DELETE. If you really do mean every row, write WHERE 1=1 — a decision, not an omission.
Backward incompatible schema change
Catches the change that breaks the app already running — dropping a column, renaming a table, adding a unique key, changing a type.
Create index concurrently
Building an index blocks writes; on PostgreSQL this insists on CONCURRENTLY, and on MySQL it caps DDL on tables past a size you set.
Drop naming convention
A table can be dropped only after it’s renamed with a _del suffix — two deliberate acts instead of one irreversible keystroke.
It runs in two places: in the Console, on every change before it’s approved; and in your GitOps workflow, as a pull-request check that comments what failed and how to fix it — caught in review, not in production.
Bytebase — the standard for database governance.