{"inline_business":{"sql-formatter":{"dialecte":"Dialect","standard_sql":"Standard SQL","2_espaces":"2 Spaces","4_espaces":"4 Spaces","tabulations":"Tabs","majuscules":"UPPER","minuscules":"lower","original":"Original","echec_formatage":"Formatting failed. Please check your SQL syntax."}},"docs_business":{"tools":{"sql":{"content":{"title":"Format a readable SQL query: rules and dialects","intro":"The formatter puts each clause (SELECT, FROM, WHERE, GROUP BY…) on its own line, indents columns and conditions by 2 or 4 spaces or a tab, and switches keywords to upper or lower case. It relies on the open-source sql-formatter library and supports 7 dialects: standard SQL, MySQL, PostgreSQL, T-SQL, PL/SQL, SQLite and BigQuery. Processing happens in the browser; the query is not sent anywhere.","details":"
[dbo].[table] in T-SQL, backticks in MySQL, ::int casts in PostgreSQL).One-line input: select u.id, count(*) as nb from users u join orders o on u.id = o.user_id where o.status = 'completed' group by u.id
Output in standard SQL, 2 spaces, upper-case keywords:SELECT u.id, count(*) AS nbFROM users u JOIN orders o ON u.id = o.user_idWHERE o.status = 'completed'GROUP BY u.id
The function name count keeps its case; only keywords change. Quoted strings and comments are kept as they are.
[dbo].[t], @p or ::int in standard SQL. The tool then shows the message and copies your text unchanged: pick the right dialect.BEGIN … END, stored procedures) are split poorly.To turn a table into a C#, Java or TypeScript class, use the SQL to code tool; this one only formats.
Sources and dates: sql-formatter library version 15.8.2 installed in the project (declared dependency ^15.3.0), whose documentation flags the identifier case option as experimental (checked 14/10/2026).
"}},"sql-formatter":{"faqs":[{"question":"Why does the SQL formatter show a parse error?","answer":"The query contains syntax the selected dialect does not recognise: SQL Server brackets [dbo].[t] or @p variables, or a PostgreSQL ::int cast in standard SQL. Select T-SQL, PostgreSQL or your database's dialect and the error goes away. While the error remains, the tool copies your text unchanged."},{"question":"Should SQL keywords be written in upper case?","answer":"SQL engines ignore keyword case: select and SELECT run the same. Upper case is a readability convention that sets keywords apart from table and column names. The tool uppercases them by default, with lower-case and unchanged options."},{"question":"Does the formatter check that my query is correct?","answer":"No: it splits and indents the text without connecting to a database. A misspelt column, a missing table or a join that multiplies rows goes unnoticed. Always test the formatted query on your database before deploying it."},{"question":"Which indentation should I use for SQL?","answer":"The tool offers 2 spaces, 4 spaces or a tab. Two spaces keep long queries compact; four spaces stand out better in code review tools. What matters most is that the whole team uses the same setting so diffs stay readable."}]}}}}