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

Cannot chain multiple ilike or filter with ilike #789

Open
harshdeep-techstax opened this issue May 3, 2024 · 9 comments
Open

Cannot chain multiple ilike or filter with ilike #789

harshdeep-techstax opened this issue May 3, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@harshdeep-techstax
Copy link

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
image

@harshdeep-techstax harshdeep-techstax added the bug Something isn't working label May 3, 2024
@silentworks
Copy link
Contributor

That's a Cloudflare error, maybe the service was down at the time you tried this. Try again and let me know the result.

@harshdeep-techstax
Copy link
Author

Still getting the same error on single ilike as well
image

@silentworks
Copy link
Contributor

Please check if your project is paused in the Supabase dashboard.

@FBosler
Copy link

FBosler commented May 14, 2024

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

@regtm
Copy link

regtm commented May 15, 2024

The % in the built query is causing your error, as the % is used for url encoding. Use * instead.

@harshdeep-techstax
Copy link
Author

The % in the built query is causing your error, as the % is used for url encoding. Use * instead.

Yeah adding * instead of % worked.

@silentworks
Copy link
Contributor

silentworks commented May 21, 2024

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.

Supabase_Filter_Like.mp4

@harshdeep-techstax
Copy link
Author

@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 *

@silentworks
Copy link
Contributor

@harshdeep-techstax Its the same results for me with either single of multiple chaining ilikes.

supabase_filter_ilike_multiple.mp4

@silentworks silentworks self-assigned this May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants