realtime icon indicating copy to clipboard operation
realtime copied to clipboard

Support more filters in addition to `eq`

Open osaxma opened this issue 3 years ago • 8 comments

Feature request

Support: neq, lt, lte, gt, and gte in addition to eq.

Use case

In my app, I'm trying to filter realtime using (realtime:public:some_table:someValue=gt.previousValue) but that's currently not possible.

Describe the solution you'd like

I would like to be able to use: neq, lt, lte, gt, and gte to filter realtime data.

Additional context

The issue was originally filed here:

  • supabase-community/supabase-flutter#91

osaxma avatar Jan 21 '22 11:01 osaxma

Related: https://github.com/supabase/walrus/issues/9

w3b6x9 avatar Jan 21 '22 22:01 w3b6x9

@w3b6x9

It looks like neq, lt, lte, gt, and gte are already supported by walrus according this comment:

  • https://github.com/supabase/walrus/issues/9#issuecomment-1018927685

But it isn't supported by realtime according to this:

  • supabase-community/supabase-flutter#91

osaxma avatar Jan 21 '22 23:01 osaxma

@osaxma walrus does support them but realtime rls server does not expose those additional filters at the moment.

w3b6x9 avatar Jan 21 '22 23:01 w3b6x9

support contains (cs) filter issue: https://github.com/supabase/realtime/issues/233

w3b6x9 avatar Feb 20 '22 01:02 w3b6x9

Is there anything we can do to help @w3b6x9?

RasmusEdvardsen avatar Feb 20 '22 12:02 RasmusEdvardsen

@RasmusEdvardsen thanks for offering! We're currently making some big changes to Realtime and will add in additional filters shortly after the new changes we're making are stable.

w3b6x9 avatar May 19 '22 23:05 w3b6x9

@w3b6x9 good to hear 🙂 Thanks for the feedback, I really like your product!

RasmusEdvardsen avatar May 20 '22 12:05 RasmusEdvardsen

I think that when this is complete, it will really help https://github.com/psteinroe/supabase-cache-helpers/pull/22/files come into its own for React users :)

Marviel avatar Sep 05 '22 16:09 Marviel

Update ... this is done actually, and pending some QA we will update the docs and let you know so you can take a look!

chasers avatar Sep 26 '22 18:09 chasers

@chasers is this planned on being released soon? We're hitting our channel limits currently because we can only do direct queries

Marviel avatar Dec 09 '22 21:12 Marviel

Per our discussion offline, these are actually on production now and more obvious with #373

chasers avatar Dec 12 '22 19:12 chasers

will eq filter also suport Strings?

LorenzFedeli avatar Dec 13 '22 22:12 LorenzFedeli

@LorenzFedeli in my experience yes

Marviel avatar Dec 13 '22 22:12 Marviel

@LorenzFedeli yes it does.

chasers avatar Dec 13 '22 23:12 chasers

I can't get it to work. To be exact I'm trying to compare to a date with yyyy-MM-ddThh:mm:ss format. .from('table:date=eq.2022-01-01T12:33:00') this gets everything from my table

LorenzFedeli avatar Dec 14 '22 07:12 LorenzFedeli

Can you try it with a normal string and see what happens? Comparing to a datetime field would likely be an edge case currently.

And if you're hosted on our platform it's usually easier if I can get a project ref. You can contact support with those details and we can take it from there if you like.

chasers avatar Dec 14 '22 23:12 chasers