How to use
- Paste the query into the SQL panel.
- Choose the dialect: PostgreSQL, MySQL or SQLite.
- Set the keyword case and indentation.
- Copy the formatted query.
Use cases
- Reading queries generated by ORMs and captured in logs.
- Standardizing SQL in code reviews and migrations.
- Documenting queries in wikis and tickets.
Technical concepts
Why the dialect matters
Each database has its own syntax: PostgreSQL uses :: for casts and $1 for parameters, MySQL uses backticks for identifiers and SQLite accepts flexible types. Picking the right dialect keeps the formatter from misreading these tokens.
Style conventions
Uppercase keywords and each main clause (SELECT, FROM, WHERE, GROUP BY, ORDER BY) on its own line are the most widespread conventions, making queries easier to read and diffs smaller in version control.
Frequently asked questions
Does formatting change the query result?
No. Only whitespace, line breaks and keyword case change; identifiers and literals are preserved.
Why do I get a parse error?
The formatter did not recognize a token in the chosen dialect, such as syntax specific to another database. Try another dialect or check parentheses and quotes.