Skip to content

feat(database): capture live updates via Postgres pgoutput - #1609

Merged
kkopanidis merged 3 commits into
feat/database-realtime-sqlfrom
cursor/sql-wal-cdc-687f
Sep 14, 2026
Merged

kkopanidis merged 3 commits into
feat/database-realtime-sqlfrom
cursor/sql-wal-cdc-687f

Conversation

@kkopanidis

@kkopanidis kkopanidis commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

  • Feature
  • Refactor
  • Bug fix

Does this PR introduce a breaking change?

  • Yes — SQL live updates are PostgreSQL WAL CDC only. MySQL, MariaDB, and SQLite live updates are out of v1. The trigger + _cnd_DatabaseChange queue is removed (leftover objects are dropped on reconcile). There is no catch-up / resume token; leader restart or slot drop skips missed events and clients refetch.

Intervention into #1602 (feat/database-realtime-sql). Does not restack onto #1601. Does not force-push feat/database-realtime-sql.

What changed

  • Capture is in-process Postgres logical decoding: pgoutput publication cnd_realtime + a temporary replication slot.
  • Topology is settings-only (wal_level=logical, max_replication_slots / max_wal_senders > 0). It does not create a probe slot (that competed with the leader’s live slot and fail-closed the feed). Slot create belongs in feed.start(); failure is degraded + retry, not sticky unsupported topology.
  • LISTEN/NOTIFY is not the capture path. No changelog table, no triggers, no Debezium.
  • SQL coordinator does not persist or restore resume tokens (persistResume: false). Event payloads may still include an LSN-shaped resumeToken field; it is not a catch-up cursor.
  • Status stays starting until the watch’s replication feed is ready. CopyData decode is try/caught; pgoutput tuples consume 'u' / 'b' so later text ids stay aligned.
  • Status/README: honest WAL CDC, Postgres-only, no catch-up.

Tests

  • Local Node 24: database tsc + 61 unit tests (3 skipped: Mongo replica-set integration, live pgoutput needing SQL_LOGICAL_URI).
  • CI will re-run on 5a216ebe.
Open in Web Open in Cursor 

Replace the SQL changelog/trigger queue with in-process WAL CDC.
Live updates are Postgres-only (temporary pgoutput slot, no catch-up);
MySQL/MariaDB/SQLite capture is out of v1.
Drop unused decoder/helpers, tautological test branches, and a
passthrough wrapper versus feat/database-realtime-sql.
Topology checks used a temporary pgoutput slot on every reconcile, which
could fail-close a live leader feed. Probe settings only; create the slot
in feed.start() and retry as degraded. Consume binary/TOAST tuple kinds,
catch CopyData decode errors, and stay starting until the watch is ready.
@kkopanidis
kkopanidis merged commit 50b76e4 into feat/database-realtime-sql Sep 14, 2026
12 checks passed
@kkopanidis
kkopanidis deleted the cursor/sql-wal-cdc-687f branch September 14, 2026 07:48
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