SQL Formatter & Query Beautifier: ANSI, PostgreSQL, MySQL & SQLite
Format, re-indent, and beautify messy or minified SQL queries with uppercase keyword standardization, clause alignment, and dialect support.
SQL Tokenization & Clause Hierarchy
Complex database queries require visual hierarchy to facilitate peer code reviews and optimize query execution planning:
- Clause Indentation: Places major SQL clauses (
SELECT,FROM,WHERE,GROUP BY,HAVING,ORDER BY) on new lines with left-aligned or river-aligned padding. - Keyword Uppercasing: Enforces standard SQL style guidelines (SQL-92/ANSI) by capitalizing reserved keywords (
JOIN,ON,AND,CASE,WHEN) while preserving table and column identifiers. - Subquery Nesting: Indents nested subqueries with balanced parenthesis blocks.
Multi-Dialect Compatibility
Formatted for modern enterprise database engines:
- Supports ANSI SQL, PostgreSQL (window functions, JSONB operators), MySQL/MariaDB, SQLite, and Microsoft T-SQL.
- Preserves multi-line block comments (
/* ... */) and single-line comments (-- ...).
Pro Tip: Practical Application
Always uppercase SQL reserved keywords to distinguish database logic from table and column names at a glance.