Why format first?
Two queries that do the same thing are often written very differently: one on a single line from an ORM log, the other hand-indented in a migration file. A plain diff marks every line as changed. With Format before comparing on, both queries are rewritten into the same canonical layout — one clause per line, one column per line, consistent indentation — and only then compared. What's left are the real differences: an added join, a changed filter, a renamed column.
Typical uses
- Checking a view or stored procedure in production against the version in source control.
- Reviewing what a dbt, Looker or ORM change did to the generated SQL.
- Comparing a slow query with the rewritten version before swapping it in.
- Spotting drift between the same report query in two environments.
Options
- Dialect — pick your database so its syntax is recognised: T-SQL
[brackets]andTOP, MySQL backticks, PostgreSQL::casts and dollar-quoted bodies, BigQuerySTRUCT, and so on. If formatting fails for an unusual statement, the tool falls back to comparing with whitespace collapsed and tells you. - Ignore case — on by default, because
selectversusSELECTis rarely a meaningful change. It also ignores case in identifiers and string literals, so turn it off if those matter. - Ignore comments — drop
--and/* */comments from both sides, for when only the logic matters.
Is my data uploaded?
No. The comparison runs in your browser, so nothing you add is sent to gratistools.be. It only leaves your device if you sign in and press Save, which stores that one comparison in your account until you delete it. See the privacy page for details.