Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(realtime): add predefined filters instead of regular String #669

Merged
merged 9 commits into from
Feb 20, 2025

Conversation

LucasAbijmil
Copy link
Contributor

@LucasAbijmil LucasAbijmil commented Feb 19, 2025

What kind of change does this PR introduce?

This PR introduces predefined filters for RealtimeChannelV2 instead of using a regular String (see my Feature Request and issue)

What is the current behavior?

A String passed as a parameter by the client (error prone)

What is the new behavior?

Use predefined filters – similar in syntax to a regular query.

@LucasAbijmil LucasAbijmil changed the title [RealTimeChannelV2] Add filters instead of regular String [RealTimeChannelV2] Add predefined filters instead of regular String Feb 19, 2025
@LucasAbijmil LucasAbijmil marked this pull request as ready for review February 19, 2025 18:50
Copy link
Collaborator

@grdsdev grdsdev left a comment

Choose a reason for hiding this comment

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

Thanks for the work here, just a few change requests.

We'd also need some tests for the new filter type.

@grdsdev grdsdev changed the title [RealTimeChannelV2] Add predefined filters instead of regular String feat(realtime): add predefined filters instead of regular String Feb 19, 2025
@LucasAbijmil LucasAbijmil force-pushed the feature/Realtime-Filters branch from a1576f5 to 6bd5fd7 Compare February 19, 2025 22:44
@LucasAbijmil
Copy link
Contributor Author

@grdsdev Let me know what you think of my update, and I'll finalize the tests based on your feedback

@coveralls
Copy link

coveralls commented Feb 19, 2025

Pull Request Test Coverage Report for Build 13441029480

Details

  • 25 of 43 (58.14%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 74.842%

Changes Missing Coverage Covered Lines Changed/Added Lines %
Sources/Realtime/RealtimePostgresFilterValue.swift 7 10 70.0%
Sources/Realtime/RealtimeChannel+AsyncAwait.swift 0 15 0.0%
Totals Coverage Status
Change from base Build 13424523309: -0.1%
Covered Lines: 5081
Relevant Lines: 6789

💛 - Coveralls

@LucasAbijmil LucasAbijmil requested a review from grdsdev February 19, 2025 23:04
Copy link
Collaborator

@grdsdev grdsdev left a comment

Choose a reason for hiding this comment

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

You're on the right track, just a few more changes.

@LucasAbijmil
Copy link
Contributor Author

You're on the right track, just a few more changes.

I hope you'll enjoy the changes :)

@LucasAbijmil LucasAbijmil requested a review from grdsdev February 20, 2025 14:27
@grdsdev grdsdev force-pushed the feature/Realtime-Filters branch from 32745e6 to f074ac2 Compare February 20, 2025 17:22
@grdsdev grdsdev merged commit 3dc9b82 into supabase:main Feb 20, 2025
19 of 20 checks passed
@AronnK
Copy link

AronnK commented Feb 25, 2025

Hey! So I'm trying to have 2 filters in my code, one .eq to a row and one change in a specific column (corresponding to that row)
So is it possible to do it now by using AND or some other means?

@grdsdev
Copy link
Collaborator

grdsdev commented Feb 25, 2025

Hi @AronnK multiple filters aren't supported yet, follow the thread supabase/realtime-js#97 to know more.

@AronnK
Copy link

AronnK commented Feb 25, 2025

Hi @AronnK multiple filters aren't supported yet, follow the thread supabase/realtime-js#97 to know more.

Hey @grdsdev, thanks for the information!

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.

[Realtime] Enhancements: Add OR and AND filters – Improve syntax and documentation?
4 participants