supabase / supabase-flutter

Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
https://supabase.com/
MIT License
698 stars 163 forks source link

Add support for multiple filters / complex queries for Realtime and stream methods #338

Open davoutuk opened 1 year ago

davoutuk commented 1 year ago

For my Flutter app I was trying to build a dynamic filtering facility for a Supabase stream, and have discovered that an exception is thrown whenever more than one filter is applied.

Why this limit?

Is there any way around this? In my case I have want to apply two field filters and the exact two fields can vary according to user interactions

dshukertjr commented 1 year ago

@davoutuk You can only have one filter on stream() due to the limitation on Supabase's realtime server currently. There is a issue on realtime repo discussing supporting more flexible queries https://github.com/supabase/realtime/issues/303.

getkey commented 9 months ago

Also related: https://github.com/supabase/realtime/issues/486

hamishjohnson commented 9 months ago

I have a workaround, by having a separate column, with the concatenated values, updated by a trigger. Easy if you just want 'eq' but you'll have to get creative if you want gt, lt etc.

getkey commented 9 months ago

Even better, as far as dirty hacks go :sweat_smile:, is to use a generated column.