SQL Diff
Compare two SQL queries or schemas after canonical formatting — ignore whitespace and casing noise.
Diff (canonicalized)+5 −4
SELECT
id,
- email
+ email,
+ last_login
FROM
users
WHERE
status = 'active'
- AND created_at > '2024-01-01'
+ AND created_at > '2024-06-01'
ORDER BY
- created_at DESC
+ last_login DESC
LIMIT
- 50;
+ 100;
How it works
Both inputs are formatted to a canonical shape (consistent keyword case, indentation, and clause breaks) and then diffed line by line. That way whitespace and casing differences don't show up as changes — only real edits do.
Use it for
- Comparing two versions of a query during a refactor
- Diffing two
CREATE TABLEstatements side by side - Spot-checking generated SQL against a hand-written reference
You might also like
- Diff CheckerCompare two pieces of text side-by-side with line- and word-level highlighting.
- JSON Structural DiffCompare two JSON values by structure — added / removed / changed paths with old and new values. Optional unordered-array mode.
- SemVer CompareCompare two SemVer 2.0.0 versions — get direction (upgrade / downgrade / equal) and the diff kind.
- SQL CREATE TABLE GeneratorInfer column types from sample data and emit CREATE TABLE for PostgreSQL, MySQL, SQLite, or SQL Server.