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

db-postgres: is like filter condition does case-insensitive text search and the result is equivalent to contains filter #6898

Open
ikenox opened this issue Jun 24, 2024 · 0 comments

Comments

@ikenox
Copy link
Contributor

ikenox commented Jun 24, 2024

Link to reproduction

No response

Describe the Bug

Both of is like and contains filter does case-insensitive search by postgres ILIKE operator, and the issued SQL and search results are idential.
I guess that is like should do case-sensitive search by postgres LIKE operator.

To Reproduce

You can reproduce the problem by _community app:

Filter by is like condition

image

SQL

select "posts"."id", "posts"."text", "posts"."title", "posts"."updated_at", "posts"."created_at", "posts__rels"."data" as "_rels" from "posts" left join lateral (select coalesce(json_agg(json_build_array("posts__rels"."order", "posts__rels"."path", "posts__rels"."media_id") order by "posts__rels"."order" asc), '[]'::json) as "data" from (select * from "posts_rels" "posts__rels" where "posts__rels"."parent_id" = "posts"."id" order by "posts__rels"."order" asc) "posts__rels") "posts__rels" on true where "posts"."text" ilike $1 order by "posts"."title" asc limit $2

Filter by contains condition

image

SQL

select "posts"."id", "posts"."text", "posts"."title", "posts"."updated_at", "posts"."created_at", "posts__rels"."data" as "_rels" from "posts" left join lateral (select coalesce(json_agg(json_build_array("posts__rels"."order", "posts__rels"."path", "posts__rels"."media_id") order by "posts__rels"."order" asc), '[]'::json) as "data" from (select * from "posts_rels" "posts__rels" where "posts__rels"."parent_id" = "posts"."id" order by "posts__rels"."order" asc) "posts__rels") "posts__rels" on true where "posts"."text" ilike $1 order by "posts"."title" asc limit $2

Payload Version

2.22.0 (db-postgres: 0.8.5)

Adapters and Plugins

No response

@ikenox ikenox added status: needs-triage Possible bug which hasn't been reproduced yet v2 labels Jun 24, 2024
@ikenox ikenox changed the title db-postgres: is like filter condition does case-insensitive texst search and the result is equivalent to contains filter db-postgres: is like filter condition does case-insensitive text search and the result is equivalent to contains filter Jun 24, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants