Status, checked 19 Nov 2026: ACTIVE. Go data-transformation engine (a dbt alternative) with an MCP server. Tagged v0.2.0-beta (
8772ad5). Last change 19 Nov 2026. Outside the gap program.Clean-clone check:
go build ./...needs a C toolchain with libstdc++ because the DuckDB plugin uses cgo. The e2e tests needmake e2efirst so thesqlforgebinary exists.Roadmap: ROADMAP.md. Program tracking: Drover gap program (M0 to M4).
Repo status (2026-11-19): active again after the 2026-11-09 rationalization marked it STALE. Every PR runs a consumer-facing smoke test (
make smoke): a fresh copy of the bundled example goes through plan β apply β test β query β docs on DuckDB. Postgres and DuckDB also run apply integration tests in CI. Config and MCP fields are indocs/reference/. The beta tag is a source tag: there are no published binaries. The roadmap is tracked in epic #65. Cross-repo map: drover-sh docs.
Part of the Drover ecosystem (cross-repo map): orchestrating autonomous agentic engineering.
SQLForge is a modern, pure Go-native alternative to dbt. It replaces Jinja templating with compile-time AST analysis via an embedded Polyglot WASM engine, giving you repeatable, agent-friendly data transformations across every major SQL warehouse.
# 1. Clone and build
git clone https://github.com/cloud-shuttle/drover-sqlforge.git
cd drover-sqlforge && make build && make plugins
# 2. Run against the bundled example (DuckDB in-memory, no server needed)
cd examples/agentic_retail_2026
../../sqlforge plan prod # preview what will be built
../../sqlforge apply prod # execute itThat's it. Eight models built, quality tests run, fingerprints saved.
β‘οΈ Continue with Tutorial: Your First SQLForge Project for a step-by-step walkthrough.
| dbt | SQLMesh | SQLForge | |
|---|---|---|---|
| Templating | Jinja (runtime) | Jinja (runtime) | Pure SQL β AST at compile time |
| Environments | Profiles | Environments | Named envs + zero-copy isolation |
| Agentic integration | dbt Cloud API | OSS MCP (experimental) | First-class MCP server + CLI |
| Binary | Python + venv | Python + venv | Single Go binary |
| Plugin model | Adapters in Python | Adapters in Python | gRPC plugin binaries |
| Data quality | YAML tests | YAML tests | YAML + singular SQL + relationship tests |
sqlforge diverges from legacy data modeling tools by prioritizing compile-time AST analysis over runtime string templating (like Jinja). See ADR 0001.
- Jinja-free: Models are pure SQL. No
{{ ref() }}blocks. Structural references resolve dependencies at parse time via the embedded WASM parser. - Environments: Named plan/apply targets (
prod,peter_dev) with isolated warehouse schemas. Non-prod targets use zero-copy isolation (e.g. ClickHouseCLONE) where supported. - Plan & apply: Terraform-style workflow. Fingerprints (AST + model config) detect logical changes, not formatting noise.
- Agent-ready: Semantic metrics, MCP read tools, and CLI plan/apply for Drover Code agents (ADR 0002).
- Lightweight core: The
sqlforgebinary has no CGO or warehouse drivers. Warehouse connectivity is handled by standalone gRPC plugin binaries (sqlforge-plugin-<dialect>).
| Warehouse | Runner | Tested against a live database |
|---|---|---|
| ClickHouse | built-in | β testcontainers integration test in CI |
| DuckDB | sqlforge-plugin-duckdb |
β apply integration test and e2e CLI smoke in CI |
| PostgreSQL | built-in | β apply integration test in CI |
| Snowflake | sqlforge-plugin-snowflake |
|
| Databricks | sqlforge-plugin-databricks |
|
| Apache Doris | sqlforge-plugin-doris |
|
| VeloDB (SelectDB) | sqlforge-plugin-velodb |
The whole project is beta (v0.2.0-beta). Postgres and DuckDB execute generated SQL in CI, including an injection regression on plan_change. "DDL snapshot tests only" means the generated SQL is checked as strings but has not been executed against that warehouse in CI.
git clone https://github.com/cloud-shuttle/drover-sqlforge.git
cd drover-sqlforge
# Build the core CLI
go build -o sqlforge ./cmd/sqlforge
# Or build everything (CLI + all warehouse plugins)
make build
make pluginsNote:
make buildalso compiles the optional React Web GUI (ui/), which requires Node 20+. If you only want the CLI,go build -o sqlforge ./cmd/sqlforgeis sufficient.
Plugin binaries are not committed. Run
make pluginsto buildsqlforge-plugin-<dialect>for your own OS and architecture. The DuckDB plugin needs CGO and a C++ toolchain.sqlforgelooks for plugins in the current directory,../../, and../../bin/. Some tests exec./sqlforgeand the plugins from the repo root, so runmake test(which builds them first) rather than a barego test ./...on a fresh clone.
Run the bundled agentic_retail_2026 example project against DuckDB (no external services needed):
cd examples/agentic_retail_2026
# Pull external SQL package dependencies
../../sqlforge deps
# Parse models and visualise the DAG
../../sqlforge parse
# Create an isolated dev environment
../../sqlforge env create my_dev
# Preview what will change
../../sqlforge plan my_dev
# Apply the changes
../../sqlforge apply my_dev
# Run all data quality assertions
../../sqlforge test my_dev
# Column-level lineage for a model
../../sqlforge lineage customer_360
# Generate the offline data catalog
../../sqlforge docs generate my_dev
open target/index.html
# Start the local Web GUI
../../sqlforge ui my_dev| Command | Description |
|---|---|
sqlforge parse |
Parse models, show DAG and fingerprints |
sqlforge plan [env] |
Show what will change (no DB writes) |
sqlforge apply [env] |
Materialise models in dependency order |
sqlforge test [env] |
Run all data quality assertions |
sqlforge lineage [model] |
Column-level upstream/downstream lineage |
sqlforge snapshot [env] |
Apply SCD Type 2 historized snapshots |
sqlforge docs generate [env] |
Compile offline HTML data catalog |
sqlforge ui [env] |
Start local Web GUI with live DAG viewer |
sqlforge mcp [env] |
Start MCP server for agentic integrations |
sqlforge env create [name] |
Create an isolated warehouse environment |
sqlforge ai explain [model] |
Explain a model through Ollama, or Gateway when ai.provider is gateway |
SQLForge supports three tiers of data quality assertions, all evaluated at apply time with zero external tooling:
-- models/stg_orders.sql
-- @test_not_null: order_id
-- @test_unique: order_id
-- @test_accepted_values: status | pending,shipped,delivered,cancelled
-- @test_relationship: customer_id to stg_customers.customer_id
SELECT ...Singular tests β custom SQL in tests/ that fail if they return any rows:
-- tests/no_negative_revenue.sql
SELECT order_id FROM stg_orders WHERE revenue < 0sqlforge docs generate [env] compiles the entire model DAG, column-level lineage, semantic metrics, data quality assertions, and model configs into a single self-contained HTML file β no server required.
./sqlforge docs generate prod
open target/index.htmlThe catalog supports offline browsing via the file:// protocol (zero CORS), making it trivially shareable via S3, GitHub Pages, or email attachment.
Define warehouse-agnostic metrics in metrics.yml:
metrics:
- name: daily_active_users
label: Daily Active Users
model: daily_metrics
expression: COUNT(DISTINCT user_id)
dimensions: [metric_date, country]Query via CLI or MCP:
./sqlforge query daily_active_users --filter "country='AU'"Start the MCP server for any Drover Code agent or compatible IDE:
./sqlforge mcp prod| Tool | Description |
|---|---|
list_models |
Model names, config, fingerprints |
get_model |
Model SQL and column lineage. Agents do not receive the SQL. |
list_metrics |
Discover semantic metrics |
query_metric |
Compile a metric to SQL. Does not execute it. |
list_snapshots |
Snapshot definitions |
plan_change |
Propose one read-only SELECT β plan_id |
apply_change |
Execute a plan_id (2h TTL) |
run_snapshot |
Run one snapshot in the server's environment |
Parameters and responses: MCP tools. Project file: sqlforge.yml. Model comments: model config.
See ARCHITECTURE.md for the full breakdown. In brief:
- WASM parser β
internal/parser/polyglot.wasmviawazerofor zero-CGO AST extraction - gRPC plugins β
cmd/plugins/sqlforge-plugin-*handle all warehouse connections; the core binary stays CGO-free - State β
.sqlforge/state.db(SQLite) tracks environments, fingerprints, and apply history - Concurrent DAG engine β models execute in parallel with sequential schema pre-creation to avoid write-write conflicts
Docs under docs/ follow DiΓ‘taxis:
docs/adr/β Architecture Decision Recordsdocs/explanation/β Concept deep-divesdocs/how-to/β Step-by-step task guidesdocs/reference/βsqlforge.yml, model comments, MCP toolsdocs/tutorials/β End-to-end walkthroughs
New pages require YAML frontmatter per the org content taxonomy; validate with scripts/validate-content-frontmatter.sh.
We welcome contributions! See CONTRIBUTING.md for setup instructions, testing strategy, and PR guidelines.
Key commands:
go test ./... # Unit tests
make e2e # Fast end-to-end CLI tests (DuckDB, milliseconds)
make smoke # Consumer smoke test: example project plan/apply/test/query/docs on DuckDB
make integration # Live ClickHouse integration tests (Docker required)
make plugins # Compile all warehouse plugin binariesSee ARCHITECTURE.md, ROADMAP.md, CONTEXT.md (domain glossary), and docs/adr/ for architecture decisions.
Apache 2.0 β see LICENSE.