Schema Diff in 1 Command

Diff two database schemas from your terminal. No signup. No API key. One curl and you get a markdown report + breaking change analysis.

Terminal
curl -X POST -H "Content-Type: application/json" -d '{
  "schemaA": "CREATE TABLE users (id INT PRIMARY KEY);",
  "schemaB": "CREATE TABLE users (id INT PRIMARY KEY, email VARCHAR(255) NOT NULL);",
  "dialect": "postgres",
  "format": "markdown"
}' https://schemalens.tech/api/free-diff

🔑 No API Key

The free tier requires no authentication. Just POST your schemas and get a response.

⚡ 5 Dialects

PostgreSQL, MySQL, SQLite, SQL Server, and Oracle migration scripts generated automatically.

🛡️ Breaking Detection

Response includes a structured breakingChanges array with severity levels and explanations.

📝 Markdown Output

Get a clean markdown diff you can paste into PR descriptions, Slack, or documentation.

Request Parameters

ParameterTypeRequiredDescription
schemaAstringYesOriginal CREATE TABLE dump
schemaBstringYesModified CREATE TABLE dump
dialectstringNopostgres, mysql, sqlite, mssql, oracle (default: postgres)
formatstringNomarkdown or json (default: markdown)

Example Response

{ "diff": "## Schema Diff Report\n\n### Modified Tables\n\n**users**\n- Added column: `email VARCHAR(255) NOT NULL`", "breakingChanges": [ { "type": "column_added", "table": "users", "column": "email", "severity": "medium", "message": "Adding a NOT NULL column without a DEFAULT may fail on existing data." } ], "tablesAdded": 0, "tablesRemoved": 0, "tablesModified": 1, "dialect": "postgres" }

More Examples

Pipe a schema file directly into the API:

Pipe from file
curl -X POST -H "Content-Type: application/json" -d '{
  "schemaA": '"'"'$(cat schema-v1.sql)'"'"',
  "schemaB": '"'"'$(cat schema-v2.sql)'"'"',
  "dialect": "mysql"
}' https://schemalens.tech/api/free-diff

Save the diff to a file for your CI pipeline:

CI pipeline
curl -X POST -H "Content-Type: application/json" -d '{
  "schemaA": '"'"'$(cat before.sql)'"'"',
  "schemaB": '"'"'$(cat after.sql)'"'"',
  "format": "markdown"
}' https://schemalens.tech/api/free-diff -o schema-diff.md

Want an interactive playground?

Test the API in your browser with live inputs, dialect selection, and syntax-highlighted output.

Open API Playground → GitHub Action