Skip to main content

SQL ReviewLinted. Reviewed. Approved.

Catch bad SQL before it ships. Linting catches typos. Semantic rules catch anti-patterns. Approval workflows catch policy violations.

SQL review architecture

Three layers. One review.

Linting

Syntax and style. Catches typos, formatting violations, and dialect mistakes before the SQL ever reaches the database.

Semantic rules

Schema-aware checks. Require primary keys, prohibit destructive cascades, enforce naming conventions, flag missing indexes.

Policy with approval

Role-based human review. Production changes route to a DBA; lower environments auto-approve; break-glass paths leave an audit trail.

SQL review in Bytebase

Reviewed at the gateway.

Bytebase runs all three layers inline. Linting and semantic rules execute on every change — in the SQL Editor, in the change workflow, in CI on pull requests. Policy with approval routes production changes to the right reviewer. Each rule has a configurable severity, scope, and engine target.

One review. Every change.

SQL review questions

Common questions.

What is SQL review?
SQL review is the practice of checking SQL — usually schema changes, but also data operations and ad-hoc queries — before it runs against production. Review happens in three layers: linting (syntax and style), semantic rules (schema-aware checks like 'every table needs a primary key'), and policy with approval (a human reviewer plus a workflow that gates the change).
What's the difference between linting, semantic rules, and review?
Linting checks the SQL itself — typos, formatting, dialect mistakes. Semantic rules check the SQL against the schema — does it require a primary key, does it use a destructive cascade, does it index foreign keys? Approval review brings a human into the loop — the rule engine flags issues, then a DBA or peer decides whether to merge. All three layers are complementary; mature teams run all three.
How does SQL review fit into CI/CD?
SQL review runs as a CI step — typically on pull requests in GitHub or GitLab. Linting and semantic rules run automatically and surface findings as PR comments or status checks. Policy with approval gates the merge: a DBA approval or a passing rule check is required before the SQL can deploy. Tools like Bytebase wire all three layers into the same Git workflow.

Explore the standard for database development