Skip to content

feat(realtime)!: flatten the postgres_changes payload - #2055

Merged
spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2657-v3-realtime-postgres-changes-payload
Nov 16, 2026
Merged

spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2657-v3-realtime-postgres-changes-payload

Conversation

@spydon

@spydon spydon commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

PostgresChangesMessage.payload is now one flat model instead of the raw {data: {...}, ids} wire shape. Closes SDK-2657.

  • payload.record, payload.old_record, payload.event, payload.schema_, payload.table, payload.columns, payload.ids at the top level. PostgresChangesData is removed.
  • commit_timestamp is a datetime, and errors is always a list[str], as in Swift and Flutter.
  • record and old_record stay plain dicts, so SDK-2992 can decode them with Table.decode_row and Table.decode_partial.
  • Migration guide and README updated.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Updates
    • PostgreSQL change messages now expose event details directly through message.payload, including the event type, table, timestamp, and current or previous record.
    • Commit timestamps are parsed as timezone-aware datetimes. Missing errors are represented by an empty list; inserts have no old_record, and deletes have no record.
  • Documentation
    • Updated migration guidance and realtime examples to reflect the payload format and explain record behavior, replica identity, and server-reported errors.

The Realtime Postgres change payload now exposes event data as flat fields instead of a nested data object. The model parses commit timestamps as timezone-aware datetimes and normalizes missing or string-valued errors to lists. Tests, package exports, README examples, migration documentation, and the compliance symbol list reflect the updated payload.

Possibly related PRs

Change: Feature

Merge Risk: Minimal · up to 06a81

The change flattens the Realtime Postgres change payload, and the code, tests, exports and migration docs appear consistent. This is a documented breaking API change. No concrete merge-blocking risk was found.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 881eb0d6-4cca-439b-b70c-4cbc8358989a
Commits

Reviewing files that changed from the base of the PR and between a2797ad and 06a81d4.

Files selected for processing: 5

  • MIGRATION.md
  • src/realtime/README.md
  • src/realtime/src/realtime/message.py
  • src/realtime/src/realtime/types.py
  • src/realtime/tests/test_postgres_changes_payload.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@spydon
spydon merged commit 569e6fa into main Nov 16, 2026
26 checks passed
@spydon
spydon deleted the lukasklingsbo/sdk-2657-v3-realtime-postgres-changes-payload branch November 16, 2026 09:27
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.

1 participant