SQL Formatter
A web-based SQL formatter that parses SQL queries into an AST using native engines where possible — GoogleSQL library for BigQuery, Microsoft ScriptDOM for MSSQL, and Apache Data Fusion Parser for other dialects — then regenerates the SQL in a consistent formatted style. It handles badly formatted SQL queries of all kinds.
What it addresses
Badly formatted SQL queries that need to be normalized into a consistent style.
Shared over time
Each entry reflects what was shared on that date. Details may have changed since then.
SQL Formatter
A web-based SQL formatter that parses SQL queries into an AST using native engines where possible — GoogleSQL library for BigQuery, Microsoft ScriptDOM for MSSQL, and Apache Data Fusion Parser for other dialects — then regenerates the SQL in a consistent formatted style. It handles badly formatted SQL queries of all kinds.
Problem: Badly formatted SQL queries that need to be normalized into a consistent style.
Audience: for my own use; shared in hopes others find it useful
Posted by @lvduan · Original comment ↗
“I built this sql formatter <https://sql.leuduan.work> for my own use - it works by parsing the SQL query to AST using native engines where possible (for BigQuery it use GoogleSQL library, for MSSQL it uses Microsoft ScriptDOM, the rest uses Apache Data Fusion Parser) and from the AST it re-generates the SQL query in a consistent formatted style. You can throw in all kind of badly formatted SQL queries and it will work just fine.”