A self-contained SQL Server environment with CDC enabled and a data generator
producing continuous inserts, updates, and deletes against a sales table.
Useful for demoing or testing an Estuary SQL Server CDC capture end-to-end.
sqlserver/— SQL Server 2022 with an init script that enables CDC, creates thesalestable, and sets up theflow_captureuser.datagen/— Python container that inserts, updates, and deletes rows indbo.salesonce per second.ngrok— exposes SQL Server publicly over TCP so the hosted Estuary connector can reach it.flow.yaml— Estuary capture spec wiring the SQL Server source to a collection in your tenant.
Set your ngrok token and start the stack:
export NGROK_AUTHTOKEN=<your-token>
docker compose up -dGrab the public host/port from the ngrok dashboard at http://localhost:4040.
flow.yaml is the spec deployed via flowctl.
It defines a SQL Server CDC capture and one binding for the dbo.sales table:
captures:
your-prefix/sqlserver-cdc/source-sqlserver:
endpoint:
connector:
image: ghcr.io/estuary/source-sqlserver:v0
config:
address: <ngrok-host>:<ngrok-port>
database: SampleDB
user: flow_capture
password: Secretsecret1
historyMode: false
bindings:
- resource:
namespace: dbo
stream: sales
target: your-prefix/sqlserver-cdc/dbo/salesBefore publishing, edit address to match the host/port from the ngrok
dashboard, and replace your-prefix with your own tenant/prefix everywhere it
appears (in flow.yaml, in the imported yamls under your-prefix/, and the
directory name itself).
Then discover, publish, and verify:
# (Re-)run discovery to refresh bindings from the source — optional once
# bindings are present.
flowctl discover --source flow.yaml
# Publish the capture and the generated collection.
flowctl catalog publish --source flow.yaml --auto-approve
# Check status; first transition should be PENDING → BACKFILLING → OK.
flowctl catalog status your-prefix/sqlserver-cdc/source-sqlserver
# Peek at a few documents flowing through the collection.
flowctl collections read \
--collection your-prefix/sqlserver-cdc/dbo/sales \
--uncommitted | headThe init.sql script provisions a dedicated CDC user the capture connects as:
- user:
flow_capture - password:
Secretsecret1 - database:
SampleDB
It also grants the permissions the connector needs (SELECT on dbo and cdc,
plus VIEW DATABASE STATE) and enables CDC on dbo.sales.