SQLMesh
$ sqlmesh Official Med RiskSQLMesh (sqlmesh) manages SQL and Python data transformation models using virtual data environments and column-level lineage. Commands like sqlmesh plan, sqlmesh render, sqlmesh test, and sqlmesh table_diff let agents preview schema diffs and run unit tests before mutating warehouse tables, though output is primarily human-formatted text rather than native JSON.
pip install sqlmesh Direct execution of sqlmesh plan, sqlmesh test, and sqlmesh table_diff inside the project repo avoids heavy MCP context serialization.
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
Supports --auto-apply, --explain, and --ignore-warnings for headless runs, but lacks a global --json flag on core commands.
sqlmesh plan --auto-applyand--explainflags- Outputs human-readable tables/diffs rather than JSON
Virtual data environments isolate changes in dev, and test, lint, and render remain read-only on remote warehouses.
- Virtual environment isolation before
prodpromotion - Read-only
sqlmesh renderandsqlmesh test
Installable via pip install sqlmesh or uvx across platforms, though warehouse extras require additional Python dependencies.
- PyPI package
sqlmeshwith optional engine extras
Combines model planning, backfills, unit tests, data audits, and table_diff in one state-aware CLI.
- Built-in
test,audit,lint, andtable_diffsubcommands
Backed by Tobiko Data and active open-source contributors under Apache-2.0.
- Active
TobikoData/sqlmeshrepository
Comprehensive ReadTheDocs manual and Click-based --help output across subcommands.
- Official documentation at sqlmesh.readthedocs.io
Security, Auth & Guardrails
Reads warehouse connection settings and gateway credentials from config.yaml or config.py and environment variables.
Apache-2.0 open-source CLI; warehouse compute charges depend on the configured backend.
# SQLMesh Agent Rules - Always run `sqlmesh test` and `sqlmesh plan --explain` on a `dev` environment before touching production. - Never pass `--auto-apply` on `prod` or invoke `sqlmesh destroy` without explicit human confirmation.
Agent-Ready Command Recipes
Safe Read-Only Queries
sqlmesh test
Executes YAML unit test fixtures against local model definitions without touching remote warehouses.
sqlmesh render my_schema.my_model
Expands macros and outputs the resolved SQL query for inspection without executing it.
Controlled Writes & Previews
sqlmesh plan dev --auto-apply --skip-tests
Applies pending model changes into an isolated dev virtual environment without interactive prompts.
Strengths for Agents
- + Virtual environments let agents test transformations safely in
devbefore promoting. - + Includes built-in
sqlmesh test,sqlmesh lint, andsqlmesh table_diffverification workflows.
Caveats & Pitfalls
- ! No global
--jsonoutput flag, requiring agents to parse terminal text. - ! Omitting
--auto-applyonsqlmesh plandrops into an interactive prompt.