Skip to content

feat: Adds new filters to increase Postgrest parity#81

Open
filipecabaco wants to merge 3 commits into
masterfrom
feat/add-filters-real-832
Open

feat: Adds new filters to increase Postgrest parity#81
filipecabaco wants to merge 3 commits into
masterfrom
feat/add-filters-real-832

Conversation

@filipecabaco

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Adds like, ilike, is, match, imatch, and isdistinct filter operators to realtime subscriptions, along with a negate flag on user_defined_filter to support NOT variants (e.g. IS NOT, IS NOT DISTINCT FROM).

This increases our parity with Postgrest filters

https://linear.app/supabase/issue/REAL-832/improve-filter-parity-based-on-postgrest

Comment thread sql/walrus_migration_0015_like_ilike_is_not_ops.sql
Comment thread sql/walrus_migration_0015_like_ilike_is_not_ops.sql
Comment thread sql/walrus_migration_0015_like_ilike_is_not_ops.sql
Comment thread test/expected/issue_55_null_passes_filters.out
Comment thread test/expected/issue_55_null_passes_filters.out
@filipecabaco filipecabaco force-pushed the feat/add-filters-real-832 branch 4 times, most recently from 3cbb2cb to 6f02022 Compare June 2, 2026 16:40
@filipecabaco filipecabaco requested a review from samrose June 2, 2026 16:44
@filipecabaco filipecabaco force-pushed the feat/add-filters-real-832 branch from 6f02022 to 541fd57 Compare June 13, 2026 09:56
Fixes the behaviour where empty array would be handled as a NULL meaning the user could be mislead into thinking that they were properly filtering data when they weren't.

The behaviour now is:
* `NULL` returns all columns
* `{}` errors out so we can inform the user

https://linear.app/supabase/issue/REAL-843/treat-empty-pg-changes-select-as-an-error
@filipecabaco filipecabaco force-pushed the feat/add-filters-real-832 branch from 541fd57 to 5919d30 Compare June 13, 2026 10:18
alter type realtime.equality_op add value 'imatch';
alter type realtime.equality_op add value 'isdistinct';

alter type realtime.user_defined_filter add attribute negate boolean;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wouldn't be this one a breaking change? After this a composite literal must supply all four fields, so any positional literal that supplies 3 fields now fails with 'Input has too few columns' .

The main concern is the write path: the Realtime server constructs these literals when a client subscribes, so the migration and the server change have to ship in lockstep — an old server against the new type will fail on every new subscription

alter type realtime.equality_op add value 'match';
alter type realtime.equality_op add value 'imatch';
alter type realtime.equality_op add value 'isdistinct';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We should be updating the README too after this change? https://github.com/supabase/walrus/blob/master/README.md?plain=1#L49

@utkarash2991 utkarash2991 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Added the inline comments

@filipecabaco filipecabaco force-pushed the feat/add-filters-real-832 branch from d09e318 to 9dc7145 Compare June 15, 2026 21:00
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.

3 participants