A dependency-free SQL formatter that produces clean, executable output across 12 SQL dialects. Format on save, surface dialect compatibility warnings, override the dialect per file.
🌐 Web tester: SQL Dialect Formatter 🐙 Source: GitHub
✨ Features
- 🎯 Format Document support — Shift+Alt+F or Format on Save just works
- 🔍 Auto-detect dialect from query content (BigQuery, Snowflake, Postgres, MySQL, T-SQL, Redshift, Databricks, Spark, Synapse, Athena)
- 🎛️ Per-file override via status-bar click
- ⚠️ Compatibility warnings in the Problems panel when your SQL uses features the selected dialect doesn't support
- 📐 Clause-per-line, one column per line, bracket-aligned subqueries, full CASE expansion
- 💬 Three comment styles supported:
--,#, multi-line/* */
🚀 Usage
- Open any SQL file (see below for supported extensions)
- Right-click → SQL: Format Document (or press Shift+Alt+F)
- The status bar shows the detected dialect — click it to override
- Any dialect-incompatible features appear in the Problems panel
📂 Works alongside other SQL extensions
This formatter activates for any file whose language is recognized as SQL or any of these SQL-family languages:
sql,bigquery,googlesql,bqsql,sql-bigquerysnowflake-sql,snowflakesql,snowflakepostgres,postgresql,pgsqlmysqltsql,sql-server,mssqlplsql,oraclesqlredshift,databricks-sql,databrickssparksql,spark-sql,hivesql,hqltrino,presto,athena,ksqlcassandra-sql,cql
If you've already installed a dialect-specific extension (e.g. the official BigQuery extension that handles .bqsql files), this formatter adds format-on-save support without taking over your file associations — Run buttons, syntax highlighting, and dialect-specific tooling all continue to work.
⚙️ Settings
| Setting | Default | Description |
|---|---|---|
sqlDialectFormatter.defaultDialect |
auto |
Default dialect — auto to detect, or pick one |
sqlDialectFormatter.commaPosition |
after |
after for col, or before for ,col |
sqlDialectFormatter.indentSize |
2 |
Spaces per indent level |
sqlDialectFormatter.showFormatToast |
true |
Brief status-bar message after each format |
🌐 Supported dialects
☁️ Cloud — Azure Synapse · Amazon Redshift · AWS Athena · Databricks · BigQuery · Snowflake 🗄️ Traditional — PostgreSQL · MySQL · SQL Server (T-SQL) · Spark SQL · Generic SQL
📜 License
MIT © 2026 EigenZ Solutions LLC