Skip to content

feat(realtime): add realtime filter builder - #1380

Open
jan-tennert wants to merge 4 commits into
masterfrom
realtime-filter-builder
Open

feat(realtime): add realtime filter builder#1380
jan-tennert wants to merge 4 commits into
masterfrom
realtime-filter-builder

Conversation

@jan-tennert

Copy link
Copy Markdown
Collaborator

What kind of change does this PR introduce?

Feature (closes #1343)

This pull request adds a new fluent builder API for constructing Postgres changes filter strings in Realtime channels, aligning filter support with PostgREST and improving developer experience. It introduces the RealtimePostgresFilterBuilder class and related types, expands filter operator support, and updates compliance documentation. Comprehensive tests are included to ensure correct behavior.

Realtime Postgres filter builder API:

  • Added the RealtimePostgresFilterBuilder class, which provides a fluent DSL for building filter strings for Postgres changes subscriptions in Realtime, mirroring the postgrest-kt filter API. This includes methods for all supported operators, automatic value escaping, and support for combining multiple conditions.
  • Integrated the builder into PostgresChangeFilter, allowing users to construct filters using the new DSL.

Filter operator support and mapping:

  • Introduced the RealtimePostgresChangesFilterOperator enum to enumerate all supported filter operators for Realtime Postgres changes, and provided a mapping to FilterOperator.

  • Added support for the ISDISTINCT operator in both FilterOperator and the filter value escaping logic.
    Testing and compliance:

  • Added comprehensive tests for the new builder and operators in RealtimePostgresFilterBuilderTest and extended tests for ISDISTINCT in PostgrestFilterBuilderTest.

  • Updated sdk-compliance.yaml to mark realtime.subscriptions.postgres_changes_filter as fully implemented and list all new API symbols.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parity(realtime): add postgres_changes filter builder, new operators and select [from supabase-js]

1 participant