Hacker News

SQL Formatter

by @lvduan

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. Hope you find it useful!

Discover more builders

Builderlust is an endless, joyful scroll of real projects people are shipping right now. Get the app to keep finding your next spark of inspiration.

📱 Coming soon to iOS & AndroidOpen in the app