VS Code
SQL Format Desk
Dialect-aware SQL formatting that refuses to apply a change if a token would be lost.
Free. Pro is planned and not for sale yet.
select id, name from users where active = 1 order by name
SELECT
id,
name
FROM users
WHERE active = 1
ORDER BY name
Designed scene. Not a screen capture.
SQL Format Desk formats SQL in VS Code, then re-tokenizes the result and compares it with the original. If a single token would change, nothing is applied. Dialect detection covers T-SQL, PostgreSQL, PL/SQL, MySQL, BigQuery, SQLite, and a generic fallback. The extension is offline and has no telemetry.
What you get
- Format document, format selection, and format on save.
- Auto-detects the dialect. The status bar shows it, and you can override it.
- Preview diff before apply. Indent, keyword case, and leading or trailing commas are configurable.
- Pro is planned, and not for sale yet: procedure and function body formatting, a shared .sqlformat.json, SQL inside JS, Python, or PHP strings, and lint hints.
- Formatting is built on sql-formatter (MIT).