Liquibase Diff Alternative in Atlas
Liquibase provides diff and diff-changelog commands to compare database schemas and generate changelogs from differences,
respectively. While useful, these commands have limitations: they require two live database connections, produce verbose output,
and don't integrate well with modern CI/CD workflows.
Atlas provides powerful alternatives with atlas schema diff and atlas schema inspect that offer more flexibility, better
output formats, and seamless integration with GitOps workflows.
Atlas can compare any schema sources: databases, SQL files, HCL files, ORM models, and migration directories can all be diffed against each other. In addition, Atlas produces the migration file needed to migrate the database to the desired state in standard, native SQL format.
Quick Comparison
| Capability | Atlas schema diff/inspect | Liquibase diff/diff-changelog |
|---|---|---|
| Compare any source to any | ✅ DB, SQL, HCL, ORM, migrations | ⚠️ Databases and offline snapshots only |
| Compare to schema files | ✅ SQL and HCL files directly | ❌ Not supported |
| Compare to ORM models | ✅ GORM, Ent, Django, Sequelize, etc. | ❌ Not supported |
| Output formats | ✅ SQL, HCL, JSON, ERD, custom | ✅ XML/YAML/JSON/SQL changelog |
| Visual ERD diff | ✅ Interactive ERD with diff view | ❌ Not supported |
| Drift detection | ✅ Continuous monitoring | ⚠️ Manual |
| CI/CD integration | ✅ GitHub Actions, GitLab, K8s, Argo CD, Terraform | ⚠️ CLI and plugins only |
This document is maintained by the Atlas team. It may contain outdated information or mistakes. For Liquibase's latest details, please refer to the official Liquibase website.
Comparing Database Schemas with Atlas
Atlas's schema diff command accepts any combination of schema sources for --from and --to. All sources can be compared
to each other in any combination.
Database URLs
Connect directly to MySQL, PostgreSQL, SQL Server, ClickHouse, SQLite, and more using standard connection URLs.
SQL Schema Code
Define your schema as plain SQL DDL statements. Great for teams familiar with SQL who want version-controlled schemas.
HCL Schema Code
Use Atlas's declarative HCL language for type-safe schema definitions with IDE support and validation.
Migration Directories
Compare against existing migration directories to detect drift or generate new migrations from schema changes.
ORM Models
Load schemas directly from your ORM: GORM, Ent, Django, SQLAlchemy, Sequelize, TypeORM, Hibernate, and more.
Compare Two Databases
Here are some examples comparing two database schemas across different database engines:
- MySQL
- PostgreSQL
- SQL Server
- ClickHouse
- SQLite
- Redshift
- Databricks
atlas schema diff \
--from "mysql://root:pass@localhost:3306/prod" \
--to "mysql://root:pass@localhost:3306/staging"
atlas schema diff \
--from "postgres://user:pass@localhost:5432/prod?sslmode=disable" \
--to "postgres://user:pass@localhost:5432/staging?sslmode=disable"
atlas schema diff \
--from "sqlserver://sa:pass@localhost:1433?database=prod" \
--to "sqlserver://sa:pass@localhost:1433?database=staging"
atlas schema diff \
--from "clickhouse://default:pass@localhost:9000/prod" \
--to "clickhouse://default:pass@localhost:9000/staging"
atlas schema diff \
--from "sqlite://prod.db" \
--to "sqlite://staging.db"
atlas schema diff \
--from "redshift://user:pass@cluster.region.redshift.amazonaws.com:5439/prod" \
--to "redshift://user:pass@cluster.region.redshift.amazonaws.com:5439/staging"
atlas schema diff \
--from "databricks://token:dapi...@workspace.cloud.databricks.com:443/prod" \
--to "databricks://token:dapi...@workspace.cloud.databricks.com:443/staging"
Atlas outputs the SQL statements needed to transform the from schema into the to schema:
-- Add new column
ALTER TABLE "users" ADD COLUMN "phone" varchar(50);
-- Create new index
CREATE INDEX "idx_users_email" ON "users" ("email");
Compare Database to Schema Code
Unlike Liquibase, Atlas can compare a live database directly to a schema file - no reference database needed:
# Compare database to SQL schema file
atlas schema diff \
--from "mysql://root:pass@localhost:3306/prod" \
--to "file://schema.sql" \
--dev-url "docker://mysql/8/dev"
# Compare database to HCL schema file
atlas schema diff \
--from "mysql://root:pass@localhost:3306/prod" \
--to "file://schema.hcl" \
--dev-url "docker://mysql/8/dev"
--dev-urlThe --dev-url flag specifies a temporary database connection used by Atlas to normalize and compare schemas. This can be a
local Docker container or any development database instance. Atlas uses this connection internally and doesn't modify your
source or target schemas. Read more at: Dev Database.
Compare Any Source to Any Other
Atlas can compare any schema sources to any other. Here are some examples:
# Compare database to ORM models
atlas schema diff \
--from "mysql://root:pass@localhost:3306/prod" \
--to "ent://ent/schema" \
--dev-url "docker://mysql/8/dev"
# Compare SQL file to HCL file
atlas schema diff \
--from "file://old-schema.sql" \
--to "file://new-schema.hcl" \
--dev-url "docker://mysql/8/dev"
# Compare migration directory to database
atlas schema diff \
--from "file://migrations" \
--to "mysql://root:pass@localhost:3306/prod" \
--dev-url "docker://mysql/8/dev"
# Compare two migration directories
atlas schema diff \
--from "file://migrations-v1" \
--to "file://migrations-v2" \
--dev-url "docker://mysql/8/dev"
Inspecting and Snapshotting Schemas
Similar to Liquibase's snapshot command, Atlas can capture database schema states for any supported source, including PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, ClickHouse, Redshift, Snowflake, and more.
- MySQL
- PostgreSQL
- SQL Server
- ClickHouse
- SQLite
- Databricks
atlas schema inspect -u "mysql://root:pass@localhost:3306/mydb" --format '{{ sql . }}'
atlas schema inspect -u "postgres://user:pass@localhost:5432/mydb?sslmode=disable" --format '{{ sql . }}'
atlas schema inspect -u "sqlserver://sa:pass@localhost:1433?database=mydb" --format '{{ sql . }}'
atlas schema inspect -u "clickhouse://default:pass@localhost:9000/mydb" --format '{{ sql . }}'
atlas schema inspect -u "sqlite://mydb.db" --format '{{ sql . }}'
atlas schema inspect -u "databricks://token:dapi...@workspace.cloud.databricks.com:443/mydb" --format '{{ sql . }}'