Skip to content

feat: AND filters in Postgres Changes#1912

Merged
filipecabaco merged 4 commits into
mainfrom
feat/postgres-changes-and-filters-real-826
May 27, 2026
Merged

feat: AND filters in Postgres Changes#1912
filipecabaco merged 4 commits into
mainfrom
feat/postgres-changes-and-filters-real-826

Conversation

@filipecabaco

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Implement AND filter support for Postgres Changes with comma separated parameters

@filipecabaco
filipecabaco force-pushed the feat/postgres-changes-and-filters-real-826 branch from 97e25f6 to 5e3c423 Compare May 26, 2026 13:11
@coveralls

coveralls commented May 26, 2026

Copy link
Copy Markdown

Coverage Status

Coverage is 91.479%feat/postgres-changes-and-filters-real-826 into main. No base build found for main.

@leandrocp leandrocp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non-blocking comments, just a question about empty filters.

Comment thread test/integration/rt_channel/postgres_changes_test.exs Outdated
Comment on lines +220 to +223
empty or whitespace-only filter string is treated as no filter:

iex> parse_subscription_params(%{"schema" => "public", "table" => "messages", "filter" => ""})
{:ok, {"*", "public", "messages", []}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Empty filters fail on main:

iex> Extensions.PostgresCdcRls.Subscriptions.parse_subscription_params(%{"schema" => "public", "table" => "messages", "filter" => ""})
{:error, "Error parsing `filter` params: [\"\"]"}

Should this change be considered a soft-breaking change or is this fine?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

not sure honestly... IMO we could see this as a bug we had and fix it or we can see it as properly informing the user of this error AS an error. wdyt?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMO an empty filter means... no filter so this change looks correct and since it used to return error, the impact of that change should be minimal.

But my question was also to understand if such changes should be listed on https://supabase.com/changelog or any other comm.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the and filter will also need to be shared as this will potentially reduce data sent so it has that benefit for us also

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To answer my own question, I think we should update realtime docs (new AND operator and this empty filter behavior change) and also announce on /changelog

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

will get the docs PR ready so we can merge almost at the same time

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread lib/extensions/postgres_cdc_rls/subscriptions.ex Outdated
@filipecabaco
filipecabaco merged commit 0d13767 into main May 27, 2026
24 checks passed
@filipecabaco
filipecabaco deleted the feat/postgres-changes-and-filters-real-826 branch May 27, 2026 13:22
@realtime-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 2.100.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants