Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

dbmate

$ dbmate Community Med Risk
Adrian Macneil · Database & Data · MIT · macos / linux / windows

dbmate 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.

FCRS-1.0 Score
81 /100
Good
Medium Confidence
Zero-Friction Install
brew install dbmate
CLI vs MCP Decision CLI Only

dbmate operates directly on local db/migrations/ SQL files and DATABASE_URL with minimal latency and zero need for MCP.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 18 / 25

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 --wait and --no-dump-schema; no --json
Trust & Safety 20 / 25

--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 rollback and DATABASE_URL env isolation; drop is destructive
Setup & Portability 14 / 15

Single static Go binary available via Homebrew, go install, Docker, and GitHub Releases across macOS, Linux, and Windows.

  • Static Go binary via brew install dbmate and releases
Utility & Efficiency 13 / 15

Minimalist Rails-inspired db/migrations + db/schema.sql workflow that works across any backend language.

  • Language-agnostic up, rollback, dump, and --wait workflow
Maintenance & Lineage 8 / 10

Popular community tool (amacneil/dbmate) under MIT license.

  • Well-maintained amacneil/dbmate MIT repository
Docs & Verifiability 8 / 10

Clear README covering every command, env var, and flag plus --help.

  • Complete usage guide in GitHub README

Security, Auth & Guardrails

Auth Modes
Env API Key Config File
Credential Storage

Reads DATABASE_URL (or DBMATE_* vars) from the environment or local .env file; also supports --env to select an alternate env var name.

Side Effects
Read-Only Local Write Remote Write Destructive
Cost & Quotas

100% free and MIT open-source.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Check applied and pending migrations
dbmate status

Prints a status checklist of applied vs. pending migrations using DATABASE_URL.

Controlled Writes & Previews

Apply pending migrations without modifying 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 .env loading and --wait make container/CI migrations effortless.
  • + --no-dump-schema lets agents avoid pg_dump/mysqldump side effects when only applying SQL.

Caveats & Pitfalls

  • ! Lacks --json output on dbmate status and has no --dry-run mode.
  • ! dbmate dump and default dbmate up depend on external pg_dump, mysqldump, or sqlite3 binaries in PATH.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI