supabase-py
supabase-py copied to clipboard
Cannot chain multiple ilike or filter with ilike
Unable to chain multiple ilike like this
supabase.table("products").select("*", count='exact').filter("name","ilike",f"%KitKat%").filter("category","ilike",f"%Candy Bar%").order(sort).limit(limit).execute()
Getting error like
That's a Cloudflare error, maybe the service was down at the time you tried this. Try again and let me know the result.
Still getting the same error on single ilike as well
Please check if your project is paused in the Supabase dashboard.
I am also getting those errors when using any kind of filtering (even on unchained fitlers), like:
-
ilike
-
like
-
filter
One operation that works is eq
. Using version 2.4.5
The % in the built query is causing your error, as the % is used for url encoding. Use * instead.
The % in the built query is causing your error, as the % is used for url encoding. Use * instead.
Yeah adding *
instead of %
worked.
I finally got around to testing this out and cannot replicate the issue you are both facing. I also looked in the postgrest repo and notice there are tests to make sure these methods were tested correctly. Here is a video I created demonstrating that this is working in my codebase.
https://github.com/supabase-community/supabase-py/assets/79497/c9074010-8c73-4356-a3e8-4ce634bd1632
@silentworks can you try chaining multiple ilikes as single ilike is working. I said multiple ilike chaining for example select().ilike("title","%Home%").ilike("description","%father%").
It is now working when I replace % with *
@harshdeep-techstax Its the same results for me with either single of multiple chaining ilikes.
https://github.com/supabase-community/supabase-py/assets/79497/2f1c360e-15ba-4f90-abe6-ee41021a82f4
Closing as this is no longer an issue as demonstrated by the video in the previous comment.
Having the same problem, looks like the fix works