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

refactor!(supabase): disallow multiple stream filter #644

Merged
merged 2 commits into from
Sep 27, 2023
Merged

Conversation

Vinzent03
Copy link
Collaborator

What kind of change does this PR introduce?

Improves developer experience around filtering .stream()

What is the current behavior?

Users could chain multiple filters on .stream() and it would not throw static error. Users could only find out that it's invalid after running the code.

supabase.from('table')
  .stream([])
  .eq('column', 'val')
  .neq('another_column', 'val')
  .lt('third_column', 'val')
  .listen((_) {});

What is the new behavior?

The above example fails at the .new statically. Additionally, I exported the SupabaseStreamBuilder class

Additional context

There was already a pr, but I think the effort of creating classes for order and limit are worth it, because I see no sense in wanting to call the same method multiple times, so I don't disallow it.

@Vinzent03 Vinzent03 changed the title refactor!: disallow multiple stream filter refactor!(supabase): disallow multiple stream filter Sep 26, 2023
Copy link
Member

@dshukertjr dshukertjr 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 this. Just had one thing about assertion, but otherwise looks amazing!

@Vinzent03 Vinzent03 merged commit c9ec6bf into next Sep 27, 2023
4 of 5 checks passed
@Vinzent03 Vinzent03 deleted the refactor/stream branch September 27, 2023 20:18
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.

2 participants