Skip to content

Add SQL Server CDC capture demo#38

Merged
danthelion merged 2 commits into
mainfrom
sqlserver_capture
May 22, 2026
Merged

Add SQL Server CDC capture demo#38
danthelion merged 2 commits into
mainfrom
sqlserver_capture

Conversation

@danthelion
Copy link
Copy Markdown
Collaborator

Summary

  • New sqlserver-cdc-capture/ example: Docker stack (SQL Server 2022 + Python datagen + ngrok) with CDC pre-enabled and the flow_capture user provisioned.
  • Includes a ready-to-publish flow.yaml for an Estuary SQL Server capture, plus the discovered tenant dani-demo/sqlserver-cdc/... collection spec.
  • Derived from sqlserver-cdc-materialize, dropping the Materialize destination; healthcheck and init script updated to use mssql-tools18 (the older mssql-tools path is no longer in the upstream image).

Test plan

  • docker compose up -d sql-server datagen brings the DB up healthy and the datagen starts producing inserts/updates/deletes
  • docker compose up -d ngrok with NGROK_AUTHTOKEN set exposes 1433 publicly
  • flowctl catalog publish --source flow.yaml --auto-approve succeeds against the running stack
  • flowctl catalog status dani-demo/sqlserver-cdc/source-sqlserverOK
  • flowctl collections read --collection dani-demo/sqlserver-cdc/dbo/sales --uncommitted returns documents

🤖 Generated with Claude Code

Self-contained Docker stack (SQL Server + datagen + ngrok) and a flow.yaml
spec for streaming dbo.sales into an Estuary collection via CDC. Built from
the existing sqlserver-cdc-materialize example, minus the Materialize
destination.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@danthelion danthelion self-assigned this May 15, 2026
@danthelion danthelion requested a review from aeluce May 15, 2026 15:46
Copy link
Copy Markdown
Collaborator

@aeluce aeluce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted a few optional places to streamline things.

@@ -0,0 +1,5 @@
collections:
dani-demo/sqlserver-cdc/dbo/sales:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible nit, since the readme instructions do call it out, but it could be helpful to signpost that the prefix needs to change, like using <your-prefix>/ rather than dani-demo/.

The auto-generated directory structure also includes dani-demo as a folder. Along with the capture flow.yaml, it's not too many places the user needs to hunt down and replace text, but could be simplified.

-- Create the watermarks table if it doesn't already exist and grant permissions
IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = 'flow_watermarks')
BEGIN
CREATE TABLE dbo.flow_watermarks(slot INT PRIMARY KEY, watermark NVARCHAR(255));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SQL Server CDC docs no longer call out watermarks table creation: it looks like read-only mode is now the default for SQL Server captures. The steps for a watermarks table could be removed as well as the mention in the readme.

Comment thread sqlserver-cdc-capture/README.md Outdated
```bash
# (Re-)run discovery to refresh bindings from the source — optional once
# bindings are present.
flowctl raw discover --source flow.yaml
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flowctl discover is now a top-level command, not just nested under raw.

- Replace dani-demo with your-prefix placeholder to signpost prefix swap
- Drop flow_watermarks setup (read-only mode is now the default)
- Use top-level flowctl discover instead of flowctl raw discover

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@danthelion danthelion requested a review from aeluce May 22, 2026 14:38
@danthelion
Copy link
Copy Markdown
Collaborator Author

@aeluce thanks for the review! Addressed all three comments in 8f5c87f:

  • Swapped dani-demo for your-prefix across the yamls and the directory itself so the placeholder is obvious
  • Dropped the flow_watermarks setup from init.sql and the README mentions
  • Updated flowctl raw discoverflowctl discover

Ready for another look when you have a sec.

@danthelion danthelion merged commit a1d4321 into main May 22, 2026
@danthelion danthelion deleted the sqlserver_capture branch May 22, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants