QA

SQL Formatter

Make a query easier to review while preserving strings and comments in supported dialects.

How this tool works

A dedicated SQL formatter handles token spacing and clause layout more reliably than regular-expression replacements. Choose generic SQL, PostgreSQL, MySQL, or SQLite syntax.

Formatting is not syntax validation and cannot guarantee meaning for every vendor extension. No query is sent to a database.

Examples

  • Format a join with a WHERE clause.
  • Keep a comment near its query.
  • Check keywords inside string literals remain text.

Common use cases

Review a long query in a pull request.

Worked synthetic example

Valid example

select id from orders where id=7

Expected: SELECT id / FROM orders / WHERE id = 7. Line breaks and casing help review clauses; the query is not executed.

Failure or warning to recognize

Warning / interpretation

Formatting a vendor-specific extension and assuming it was validated.

Expected: A vendor extension may still receive formatted output; that output does not certify SQL syntax or query meaning.

Related guides

Official references

Related tools

SQL Formatter: Lay out SQL for review | DevPouch