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

SQLMesh

$ sqlmesh Official Med Risk
Tobiko Data · Database & Data · Apache-2.0 · macos / linux / windows

SQLMesh (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.

FCRS-1.0 Score
80 /100
Good
Medium Confidence
Zero-Friction Install
pip install sqlmesh
CLI vs MCP Decision CLI Preferred vs MCP

Direct execution of sqlmesh plan, sqlmesh test, and sqlmesh table_diff inside the project repo avoids heavy MCP context serialization.

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 19 / 25

Supports --auto-apply, --explain, and --ignore-warnings for headless runs, but lacks a global --json flag on core commands.

  • sqlmesh plan --auto-apply and --explain flags
  • Outputs human-readable tables/diffs rather than JSON
Trust & Safety 21 / 25

Virtual data environments isolate changes in dev, and test, lint, and render remain read-only on remote warehouses.

  • Virtual environment isolation before prod promotion
  • Read-only sqlmesh render and sqlmesh test
Setup & Portability 12 / 15

Installable via pip install sqlmesh or uvx across platforms, though warehouse extras require additional Python dependencies.

  • PyPI package sqlmesh with optional engine extras
Utility & Efficiency 13 / 15

Combines model planning, backfills, unit tests, data audits, and table_diff in one state-aware CLI.

  • Built-in test, audit, lint, and table_diff subcommands
Maintenance & Lineage 8 / 10

Backed by Tobiko Data and active open-source contributors under Apache-2.0.

  • Active TobikoData/sqlmesh repository
Docs & Verifiability 7 / 10

Comprehensive ReadTheDocs manual and Click-based --help output across subcommands.

  • Official documentation at sqlmesh.readthedocs.io

Security, Auth & Guardrails

Auth Modes
Config File Env API Key
Credential Storage

Reads warehouse connection settings and gateway credentials from config.yaml or config.py and environment variables.

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

Apache-2.0 open-source CLI; warehouse compute charges depend on the configured backend.

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

Run model unit tests locally
sqlmesh test

Executes YAML unit test fixtures against local model definitions without touching remote warehouses.

Render compiled model SQL
sqlmesh render my_schema.my_model

Expands macros and outputs the resolved SQL query for inspection without executing it.

Controlled Writes & Previews

Apply plan to a non-prod virtual environment
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 dev before promoting.
  • + Includes built-in sqlmesh test, sqlmesh lint, and sqlmesh table_diff verification workflows.

Caveats & Pitfalls

  • ! No global --json output flag, requiring agents to parse terminal text.
  • ! Omitting --auto-apply on sqlmesh plan drops into an interactive prompt.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI