dbmate
$ dbmate Community Med Riskdbmate is a zero-dependency Go migration CLI supporting PostgreSQL, MySQL, SQLite, and ClickHouse. It reads DATABASE_URL from .env automatically, waits for database readiness in CI/Docker (--wait), and manages up, rollback, status, and dump.
brew install dbmate dbmate operates directly on local db/migrations/ SQL files and DATABASE_URL with minimal latency and zero need for MCP.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Deterministic non-interactive commands (status, up, new, dump) with .env support and --wait, though it lacks --json and --dry-run.
- Non-interactive
.env-aware CLI with--waitand--no-dump-schema; no--json
--no-dump-schema prevents unintended local file writes and rollback steps back one migration at a time, though dbmate drop deletes databases without confirmation.
- Single-step
rollbackandDATABASE_URLenv isolation;dropis destructive
Single static Go binary available via Homebrew, go install, Docker, and GitHub Releases across macOS, Linux, and Windows.
- Static Go binary via
brew install dbmateand releases
Minimalist Rails-inspired db/migrations + db/schema.sql workflow that works across any backend language.
- Language-agnostic
up,rollback,dump, and--waitworkflow
Popular community tool (amacneil/dbmate) under MIT license.
- Well-maintained
amacneil/dbmateMIT repository
Clear README covering every command, env var, and flag plus --help.
- Complete usage guide in GitHub README
Security, Auth & Guardrails
Reads DATABASE_URL (or DBMATE_* vars) from the environment or local .env file; also supports --env to select an alternate env var name.
100% free and MIT open-source.
# dbmate Agent Rules - Always run `dbmate status` before `dbmate up` or `dbmate rollback`. - Pass `--no-dump-schema` if `pg_dump`/`mysqldump` is unavailable or you do not want `db/schema.sql` touched. - NEVER run `dbmate drop` on non-ephemeral databases.
Agent-Ready Command Recipes
Safe Read-Only Queries
dbmate status
Prints a status checklist of applied vs. pending migrations using DATABASE_URL.
Controlled Writes & Previews
schema.sql dbmate --no-dump-schema --wait up
Waits for DB readiness and applies pending migrations without rewriting db/schema.sql.
Strengths for Agents
- + Native
.envloading and--waitmake container/CI migrations effortless. - +
--no-dump-schemalets agents avoidpg_dump/mysqldumpside effects when only applying SQL.
Caveats & Pitfalls
- ! Lacks
--jsonoutput ondbmate statusand has no--dry-runmode. - !
dbmate dumpand defaultdbmate updepend on externalpg_dump,mysqldump, orsqlite3binaries inPATH.