SQL pipelines for ClickHouse

Change streaming pipelines without downtime.

Declarative SQL. Instant promotion. Instant rollback.

SQLTide builds each change beside the live version, so your queries move to it, or back again, with one command.

pip install sqltide
Try the demo Read the docs
sqt build
…
✓ tbl__order_report   2 rows, staged beside published …

✓ Build complete  deployment 20261129T135149Z_85b78c staged …

sqt deployment promote --latest
✓ Promoted  20261129T135149Z_85b78c …, 1 view switched, 0.49s
└── tbl__order_report  → tbl__order_report__20261129T135149Z_85b78c
Undo with sqt deployment rollback --previous

sqt deployment rollback --previous
…
Roll back to 20261129T135141Z_530e63? [y/N] y
✓ Rolled back  to 20261129T135141Z_530e63 …, 1 view switched, 0.14s
└── tbl__order_report  → tbl__order_report__20261129T135141Z_530e63

Where pipeline changes go wrong

Rebuilds happen in front of users

Change a materialized view and its table empties and refills while people query it.

History gets left behind

A new version only sees events from now on, unless someone backfills it by hand.

There’s no way back

Once the old table is gone, undoing a bad change means rebuilding it.

How a change goes live

Your query reads the same view throughout. Only what it points at changes.

01 · Write

Declare the pipeline in SQL

Each model is a typed SQL file. sqt plan shows what a change rebuilds, and changes nothing.

Read a plan →
-- pipelines/pl__orders/order_report.sql
SELECT
  order_id::UInt64 AS order_id,
  status::String AS status,
  total_cents::Int64 AS total_cents,
  …
FROM __source("orders")
WHERE status = 'completed'

sqt plan -v
…
Rebuild (1)  as a new deployment in sqltide_playground  …
└── tbl__order_report  replay playground_orders, all retained history
    ├── reason   query changed (mv__order_report)
    ├── creates  tbl__order_report, mv__order_report under deployment names
    ├── …
    └── diff     mv__order_report
                 …
                 +WHERE status = 'completed'
02 · Build

Build beside the live version

The new version fills from the events already stored in ClickHouse. Your queries keep reading the current one.

Build a version →
# sqltide_project.toml
[defaults]
pipeline_mode = "virtual"

sqt build
…
Rebuild (1)  as a new deployment in sqltide_playground  …
└── tbl__order_report  replay playground_orders, all retained history
    └── reason  query changed (mv__order_report)
…
Proceed with build? [y/N] y
✓ tbl__order_report   2 rows, staged beside published …

✓ Build complete  deployment 20261129T135149Z_85b78c staged …, 2 rows, 5.56s
Next:
  sqt deployment audit 20261129T135149Z_85b78c      check it
  sqt deployment promote 20261129T135149Z_85b78c    publish it to consumers
03 · Check

Compare on live data

New events reach both versions, so you can compare them side by side before anyone sees the change.

Compare and audit →
# two new orders arrive, then the same query runs against both versions
sqt playground query consumer.sql --compare
Published (what consumers read):
order_id  status     total_cents
1         completed  2500
2         pending    1800
3         completed  4200
4         completed  3100
5         pending    900
(5 rows)

Unpublished deployment 20261129T135149Z_85b78c:
order_id  status     total_cents
1         completed  2500
3         completed  4200
4         completed  3100
(3 rows)
04 · Promote

Switch over in one command

Promoting points the views your queries read at the new version. No data moves, so it takes moments.

Promote a version →
sqt deployment promote --latest
✓ Promoted  20261129T135149Z_85b78c …, 1 view switched, 0.49s
└── tbl__order_report  → tbl__order_report__20261129T135149Z_85b78c
Undo with sqt deployment rollback --previous

sqt playground query consumer.sql
order_id  status     total_cents
1         completed  2500
3         completed  4200
4         completed  3100
(3 rows)
05 · Roll back

Go back just as fast

The previous version keeps running after promotion. Rolling back points the views at it again, with every event it received in the meantime.

Roll back →
sqt deployment rollback --previous
Roll back (1)  in sqltide_playground
└── tbl__order_report  20261129T135149Z_85b78c → 20261129T135141Z_530e63

Roll back to 20261129T135141Z_530e63? [y/N] y
✓ Rolled back  to 20261129T135141Z_530e63 …, 1 view switched, 0.14s
└── tbl__order_report  → tbl__order_report__20261129T135141Z_530e63
Undo with sqt deployment rollback 20261129T135149Z_85b78c

sqt playground query consumer.sql
order_id  status     total_cents
1         completed  2500
2         pending    1800
3         completed  4200
4         completed  3100
5         pending    900
(5 rows)

Real sqt output from the playground, cut down where marked ….

Built for streaming

Replay stored history

Rebuild a table from the source history SQLTide keeps in ClickHouse.

How replay works →

Test models with example data

Write SQL tests with fixed inputs and run them with sqt test before you deploy.

SQL testing →

See what’s running

sqt dev opens a local UI with your models, sources, runs and deployments.

Open the UI demo →

Start in a minute

The playground creates a small orders project and runs ClickHouse for it in Docker.

  • ClickHouse, with Python 3.12 or newer.
  • Free and open source, Apache-2.0.
pip install sqltide
sqt playground
✓ Created  sqltide-playground …
…
✓ Playground running  …, 4.90s

Next:
  cd sqltide-playground
  sqt build

Ship your next change without downtime

Look around the UI in your browser, or follow the quickstart on your machine.