Skip to content

Compare

SQLBuild vs Bruin

Bruin runs your SQL. SQLBuild reads it as one graph and checks it before anything runs.

Bruin checks a query by dry-running it on the warehouse, so every table it reads must already exist. sqb compile checks columns, types and functions offline, from your project alone, before any table is built.

$ sqb compile
error[B002]: Unknown column 'qty' in stg_orders (as o)
model: fact_orders
--> sql/models/marts/fact_orders.sql:16:5
|
16 | o.qty,
| ^^^
= note: stg_orders has: quantity, status, waffle_type_id, customer_id, order_id, ordered_at
= help: did you mean 'quantity'?

See What sqb compile checks.

Bruin splits a project into pipelines, and dependencies between them need Bruin Cloud. Its column lineage follows the columns you declare on each asset. SQLBuild compiles the whole project as one graph and traces columns from the SQL itself.

$ sqb lineage stg_orders.ordered_at --direction downstream
Column trace stg_orders.ordered_at downstream
├── daily_order_partitioned.order_date (cast)
├── daily_revenue.revenue_date (cast)
└── fact_orders.ordered_at (direct)
├── customer_status_snapshot.last_ordered_at (aggregation)
├── hourly_order_activity.activity_hour (expression)
│ ├── daily_activity_rollup.activity_day (expression)
│ │ └── hourly_activity_with_daily_context.activity_day (from SELECT *)
│ └── hourly_activity_with_daily_context.activity_hour (from SELECT *)
└── order_status_index.ordered_at (direct)

See Column lineage.

The same graph tells sqb build --changed what to run: every model whose compiled SQL changed, and everything downstream of it. Bruin’s --modified matches changed files to assets, so an edit to a shared macro selects nothing.

Here a macro edit changes fact_orders, and the plan picks up the five models that read it:

$ sqb plan --changed
…
Query changed (1)
└── fact_orders continue forward
└── query diff:
- w.price_cents * o.quantity AS line_total_cents,
+ CAST(w.price_cents AS BIGINT) * o.quantity AS line_total_cents,
…
Downstream of changes (5)
├── customer_status_snapshot reads fact_orders
├── daily_activity_rollup reads hourly_order_activity
├── hourly_activity_with_daily_context reads hourly_order_activity
├── hourly_order_activity reads fact_orders
└── order_status_index reads fact_orders
Unchanged (7): skipped by --changed

See Planning.

A Bruin unit test checks one asset, with its inputs mocked, on the warehouse. A SQLBuild test mocks the sources and runs every model in between, on DuckDB on your laptop or on the warehouse.

SQLBuild Bruin
Tests across several models Mock the sources, run every model in between One asset, its inputs mocked
End-to-end scenarios Source fixtures through the real model graph No
Warehouse SQL on your laptop Converted to DuckDB No; tests run on the asset’s connection
Macro, UDF and table function tests Yes No
Typed, parameterised cases Yes No

Here the first test runs three real models from mocked sources:

$ sqb test
Tests ready 4 selected, 4 local
1/4 test test_daily_revenue_chain PASS local 0.02s 3 real models
2/4 test test_fact_orders PASS local 0.01s 1 real model
3/4 test calculates_line_total_cents PASS local 0.01s
4/4 test test_stg_orders PASS local 0.01s 1 real model
✓ Completed successfully PASS=4 FAIL=0 TOTAL=4 (0.43s)

See Tests and Scenarios.

Bruin’s built-in policies check metadata such as owners, descriptions and names. SQLBuild Rules read what the compiler knows about your SQL, so a review comment becomes an error that points at the line.

SQLBuild Bruin
Built-in rules 205 20, on metadata
What they check Models, the graph, tests, jobs and sensors, and your Python code Assets and pipelines
Custom rules Python functions on the compiler’s facts One-line expr expressions over an asset’s fields

Here a team rule stops a mart reading a raw source directly:

rules/layers.py
@rule(
code="XSQBRARCH001",
message="Marts must read sources through staging",
remediation="Reference a staging model with __ref() instead.",
)
def marts_use_staging(*, model: Model, ctx: RuleContext) -> list[Finding]:
layer = ctx.project.tree.relative_parts(path=model.path, under="models")[0]
sql = ctx.sql.for_model(model).authored.source
if layer != "marts" or "__source(" not in sql:
return []
line = sql[: sql.index("__source(")].count("\n") + 1
return [ctx.finding(subject=model, line=line)]
$ sqb compile
error[XSQBRARCH001]: Marts must read sources through staging
--> models/marts/daily_revenue.sql:24:1
|
24 | INNER JOIN __source("raw__payments") p ON o.order_id = p.order_id
| ^
= help: Reference a staging model with __ref() instead.

See Rules.

Bruin’s open-source CLI comes with a VS Code extension; its web UI, scheduling, roles and SSO are in Bruin Cloud. SQLBuild includes all four, self-hosted and free.

SQLBuild Bruin
Web UI Included, self-hosted Bruin Cloud
Scheduler Included, self-hosted Bruin Cloud, or your own cron or Airflow
Roles Free, down to the model Bruin Cloud
SSO Free Bruin Cloud’s Scale plan
SQLBuild Web UI run graph showing loaded sources, a seed, staging views and marts tables, all succeededSQLBuild Web UI run graph showing loaded sources, a seed, staging views and marts tables, all succeeded
One job run in the SQLBuild UI: loading, seeds and models in a single graph.

See the Web UI.

Every feature, side by side, is in the Feature Comparison.