How to Format SQL

Aug 16, 2026

Indent SQL clauses so reviews are readable. Formatting is not execution and should stay local.

Readability first

Keyword-aligned SQL is easier to scan: SELECT list, FROM, JOINs, WHERE, GROUP BY, ORDER BY, LIMIT. The SQL formatter inserts line breaks around those clauses in your browser.

It does not run the query

DNVERSE has no database connection for this tool. Formatting will not tell you if an index exists. Keep credentials out of the editor.

A review habit

1. Format the statement. 2. Check JOIN conditions and NULL handling. 3. Confirm LIMIT on exploratory queries.

For extracting IDs from text, the regex tester can help before you write a WHERE IN list.

Dialects differ. The formatter is a reading aid, not a MySQL or Postgres canonicalizer.