Reading a query generated by an ORM
ORM output arrives as one long line with generated aliases. Formatting reveals the join order and the actual predicates, which is where N+1 and accidental cross joins become visible.
Formats SQL queries for readability — entirely in your browser.
—Formats SQL queries for readability — entirely in your browser.
SELECT a,b FROM t WHERE a=1 AND b=2
SELECT a, b FROM t WHERE a = 1 AND b = 2
Keywords, clauses and commas are aligned.
Formatting is cosmetic — the query semantics are unchanged.
Your input is processed entirely in your browser and never sent to a YAS server.
API automation is not supported for this tool. Runs client-side — SQL text must not leave your browser. This tool intentionally cannot be executed through the YAS API (server-side).
This tool runs in your browser and cannot be executed through the YAS API. Runs client-side — SQL text must not leave your browser.
The statement is tokenised into keywords, identifiers, literals, operators and comments, then re-emitted with keywords uppercased and clauses placed on their own lines with consistent indentation. Nested subqueries and parenthesised expressions increase the indent level, JOIN conditions are aligned under their JOIN, and comma-separated select lists are broken so that adding a column produces a one-line diff.
Formatting is purely lexical. The formatter does not parse the query into a relational algebra tree, connect to a database or know your schema, so it cannot tell you whether a column exists, whether a join is valid, or how the planner will execute it. Any statement that tokenises will be formatted, including one that the server would reject.
ORM output arrives as one long line with generated aliases. Formatting reveals the join order and the actual predicates, which is where N+1 and accidental cross joins become visible.
Consistent formatting makes the logical structure — which conditions belong to which clause — reviewable without mentally re-parsing the text.
Indentation exposes operator precedence mistakes: an OR at the wrong nesting level inside a WHERE clause is nearly invisible on one line and obvious once formatted.
Formatting every statement the same way turns migration diffs into semantic diffs, which matters when reviewing schema changes under time pressure.
What this tool deliberately does not do, and where it will disagree with other implementations.