This repository was archived by the owner on Aug 7, 2026. It is now read-only.
refactor: deprecate two-step postgres_changes API for OnPostgresChange - #78
Merged
Conversation
Mark Register(PostgresChangesOptions) and AddPostgresChangeHandler [Obsolete], pointing at OnPostgresChange, which registers the option and binds the handler in a single call. Route Client's internal registration through a non-obsolete seam, and move in-repo callers (tests, Examples) onto OnPostgresChange so the tree stays warning-clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Deprecates the two-step
postgres_changesregistration API in favor ofOnPostgresChange(added in an earlier PR), which registers the option andbinds the handler in one call.
[Obsolete("Favor OnPostgresChange instead.")]onRealtimeChannel.Register(PostgresChangesOptions)and
AddPostgresChangeHandler, plus theirIRealtimeChanneldeclarations.Client.Channel(database, schema, table, …)registers through an internalseam (
RegisterPostgresChangesOptions) instead of the now-obsolete publicRegister, so the library itself staysCS0618-free.Examples/) moved ontoOnPostgresChangeto keepthe zero-new-warnings bar.
MIGRATION_v8.mdrecords the deprecation and its replacement.Why
OnPostgresChangesupersedes theRegister(...)+AddPostgresChangeHandler(...)pairing (and the bare
AddPostgresChangeHandleron an auto-*channel). Steeringcallers there with a compile-time
[Obsolete]is the deprecation half of thatmigration, deferred out of the additive PR so the two land cleanly.
Not a removal
The methods still work — [Obsolete] is a compile-time warning only. Removal is
planned for the next major (v8), tracked in MIGRATION_v8.md.
Scope
Deliberately limited to the postgres_changes handler API. The draft #54 also
obsoleted PostgresChangesOptions.Parameters and the multi-param Channel(...)
overload; both are tangled (the Parameters ctor path, the channel-naming work)
and are left as separate follow-ups.
Relationship to #54
Fourth PR derived from the stale draft #54. #54 added the [Obsolete] markers but
left every in-repo caller emitting CS0618; this migrates them so the change is
actually warning-clean under our gate.
Testing
OnPostgresChange; full realtime suite green.