Skip to content

Database schema diff

Paste two SQL schemas and instantly see what changed — added tables, removed columns, modified types, and constraint differences. All in your browser, nothing sent to a server.

Schema differences
Removed Added Modified

What is a database schema diff?

A database schema diff compares the structure of two databases — or two versions of the same database — and highlights exactly what changed. Unlike a text diff, which compares raw characters, a schema diff understands tables, columns, types, and constraints, giving you a semantic view of structural changes.

When to use a schema diff tool

  • Auditing migration files — paste the before and after states to verify the migration does what you expect
  • Code reviews — compare the schema changes in a pull request without mentally parsing raw DDL
  • Debugging production issues — compare the production schema with staging or development to find unexpected drift
  • Documenting schema evolution over time for compliance or onboarding
  • Validating ORM-generated migrations against hand-written DDL

How the comparison works

The tool parses both schemas, extracts each CREATE TABLE statement, and builds a map of tables to columns (with types, constraints, and defaults). It then performs a structural comparison: new tables, dropped tables, new columns, dropped columns, and type or constraint changes are all identified and displayed in a clear report.

Track schema changes automatically with Basedash

Rather than manually diffing schemas, Basedash connects directly to your database and gives you a live view of tables, columns, and relationships. When your schema changes, Basedash reflects the new structure automatically — no manual exports or paste-and-compare needed.

FAQ

How does the schema diff work?

The tool parses both SQL schemas to extract table and column definitions, then compares them structurally. It identifies tables that were added or removed, columns that were added, removed, or modified (type changes, constraint changes), and presents the differences in a clear, color-coded report.

Is my schema stored or sent to a server?

No. The entire comparison runs in your browser using JavaScript. Your schema definitions are never transmitted, logged, or stored anywhere.

Which SQL dialects are supported?

The parser handles standard CREATE TABLE syntax used by PostgreSQL, MySQL, SQLite, and SQL Server. Dialect-specific extensions like PostgreSQL's array types or MySQL's ENGINE clauses are parsed on a best-effort basis.

Can I compare schemas from different databases?

Yes. Since the comparison is structural, you can paste a PostgreSQL schema on the left and a MySQL schema on the right. The tool compares table and column names, types, and constraints regardless of dialect-specific syntax differences.

Does it detect renamed columns?

No. The diff compares by column name, so a renamed column will appear as one removed column and one added column. Rename detection would require heuristics that could produce false positives.

Can I use this for migration audits?

Absolutely. Paste the before-migration schema on the left and the after-migration schema on the right to verify that the migration does exactly what you intended — no more, no less.

Skip the SQL — let AI build your charts

Connect your data and describe what you want to see. Basedash handles the query, visualization, and dashboard.