Formats
SQL Formatter
Format and beautify SQL queries.
How to use it
- Open Devly from the wrench in your menu bar, or press ⌃⌥⌘D. Press ⌘P, type SQL Formatter and press Return.
- Paste or type your text into Input.
- Adjust the Options on the right if you need to. The defaults are listed below.
- Press Format, or ⌘↵.
- Use Copy or ⇧⌘C to copy the result. ⌘L clears everything.
Options
| Option | Values | Default |
|---|---|---|
| Keyword caseCase for SQL keywords | UPPERCASE, lowercase, Capitalize | UPPERCASE |
| Indent SpacesNumber of spaces for indentation | 1–8 | 2 |
| New line before AND/ORPlace AND/OR on new lines | On or off | On |
| Comma at start of linePlace commas at beginning of lines | On or off | Off |
Example
Real output from Devly, with the default options.
Input
select u.id, u.name, count(o.id) as orders from users u left join orders o on o.user_id = u.id where u.created_at > '2026-01-01' group by u.id, u.name order by orders desc limit 10;
SELECT u.id, u.name, COUNT(o.id) AS orders FROM users u LEFT JOIN orders o ON o.user_id = u.id WHERE u.created_at > '2026-01-01' GROUP BY u.id, u.name ORDER BY orders DESC LIMIT 10;
From Terminal
With the free command-line tool installed:
Terminal
devly sqlformat --path input.txt # or pipe text in pbpaste | devly sqlformat
Quick Switch also finds it by: sql, format, beautify, query, database, mysql, postgresql.
More Formats tools
JSON FormatterFormat, validate, and minify JSON with syntax highlightingJSON Path QueryQuery JSON data using JSONPath expressionsJSON ↔ YAMLConvert between JSON and YAML formatsYAML FormatterFormat, validate, and beautify YAML documentsXML FormatterFormat, validate, and beautify XML documentsXML ↔ JSONConvert between XML and JSON formats