Skip to content
BEAD

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;
</>Use this tool programmaticallycurl · JavaScript · MCP

Same tool, callable from any HTTP client or from Claude (via MCP). Anonymous: 100 req/day per IP. Sign up for 1,000 req/day.

curl
curl https://api.b-e-a-d.com/tools/sql-diff/run \
  -H "Content-Type: application/json" \
  -d '{
  "left": "a",
  "right": "a",
  "dialect": "sql"
}'
JavaScript (fetch)
const res = await fetch("https://api.b-e-a-d.com/tools/sql-diff/run", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "left": "a",
  "right": "a",
  "dialect": "sql"
}),
});
const data = await res.json();
console.log(data.result);
MCP (Claude Desktop / Claude Code)
# In Claude Desktop / Claude Code, add to your MCP config:
{
  "mcpServers": {
    "bead": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.b-e-a-d.com"]
    }
  }
}

# Then ask Claude to call:
mcp__bead__bead_sql_diff

Full reference: developer docs · OpenAPI spec

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 TABLE statements side by side
  • Spot-checking generated SQL against a hand-written reference

You might also like