SYSTEM Cited by 1 source
Atlas CLI¶
Atlas CLI (atlasgo.io) is an open-source schema-management tool from Ariga for relational databases. It treats the database schema as a file — by convention an HCL document — and reconciles the live database against that file by computing a diff and issuing the necessary DDL. The tool is engine-aware but vendor-agnostic: it speaks the MySQL / Postgres / MariaDB / SQLite / SQL Server / ClickHouse wire protocols directly and is not tied to any particular managed- database vendor.
Primitives¶
atlas schema inspect— introspect a live database and emit an HCL file describing the current schema (tables, columns, constraints, indexes, charset, collation). Bootstraps an Atlas workflow from an existing database without rewriting the schema.atlas schema apply— re-inspect the live database, compare it against the supplied HCL file, print the imperative DDL diff ("Planned Changes: …"), promptApply / Abort, then execute the DDL. Supports--auto-approvefor CI/CD.atlas migrate— alternative versioned-migration mode (not covered in the 2022 PlanetScale post) where Atlas emits migration files on diff rather than applying directly — a bridge to teams that prefer file-per-version ceremony (Flyway / Liquibase / ActiveRecord) over pure declarative reconciliation.
Schema DSL¶
- HCL (HashiCorp Configuration Language) is the default — same DSL family as Terraform, which makes Atlas ergonomically familiar to teams already using Terraform for infrastructure. JSON is supported as a machine-readable alternative.
- Column attributes encoded include type, nullability,
default, auto-increment, character set, collation,
and constraints. Primary keys are declared via a
dedicated
primary_keyblock. - Schema-level attributes include charset + collation
defaults; the emitted HCL in the 2022 worked example
pairs
utf8mb4+utf8mb4_0900_ai_ci(MySQL 8 defaults — see concepts/utf8mb4-vs-utf8).
Connection model¶
Atlas connects via a standard wire-protocol URL —
e.g. mysql://<user>:<pass>@<host>/<db>?tls=true for a
TLS-enforced MySQL endpoint such as PlanetScale. The
URL is the single integration point with any managed-
database vendor; Atlas does not require special
vendor-side cooperation.
Vendor compatibility trade-offs¶
Atlas's approach (issue DDL directly over the MySQL protocol to reconcile the live database against the HCL file) conflicts with vendor-managed schema- change pipelines that expect schema changes to flow through the vendor's own UI / API. Canonical example: PlanetScale's safe migrations feature blocks direct DDL against production, routing schema changes through PlanetScale's deploy-request + branching workflow instead. To use Atlas against a PlanetScale database the operator must disable safe migrations (Source: [[sources/2026-04-21-planetscale-declarative-mysql- schemas-with-atlas-cli]]). Declarative tools and vendor-managed schema-change pipelines are rivals, not complements — the customer picks one ceremony.
Role in the patterns/declarative-schema-management pattern¶
Atlas is the canonical reference implementation of the declarative-schema-management pattern in the sysdesign-wiki corpus. Its four-element shape matches the pattern:
- Desired-state file —
schema.hcl. - Inspect primitive —
atlas schema inspect. - Diff engine — computed by the
applycommand. - Apply primitive —
atlas schema applywith operator-in-the-loop confirmation.
Skeema, Bytebase, and Prisma Migrate (in prisma db
push mode) are sibling implementations not yet
canonicalised on the wiki.
Seen in¶
- [[sources/2026-04-21-planetscale-declarative-mysql-
schemas-with-atlas-cli]] — first canonical wiki
mention. Brian Morrison II walks through the two-
command
inspect/applyworkflow on a PlanetScale MySQL branch: editschema.hclto add adescriptioncolumn to ahotelstable,atlas schema applyprints the plannedALTER TABLE … ADD COLUMN …diff and prompts for confirmation, applies on enter. Post flags PlanetScale's safe-migrations feature as a must-disable precondition. Tutorial voice, not deep-dive — Atlas's internals (diff algorithm, destructive-change handling, policy/lint engine,migrateversioned mode) are not covered.
Related¶
- systems/mysql — engine.
- systems/postgresql — also supported.
- systems/planetscale — target managed-MySQL vendor in the canonical wiki example.
- concepts/schema-as-code — the database-equivalent- of-IaC concept Atlas instantiates.
- concepts/online-ddl — the engine-level primitive Atlas ultimately invokes.
- patterns/declarative-schema-management — the canonical pattern Atlas implements.