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

feat: stringtheory.like(haystack text, search text) -> boolean #4

Open
wuputah opened this issue Feb 1, 2024 · 0 comments
Open

feat: stringtheory.like(haystack text, search text) -> boolean #4

wuputah opened this issue Feb 1, 2024 · 0 comments

Comments

@wuputah
Copy link
Member

wuputah commented Feb 1, 2024

This is a possible proposal to implement:

stringtheory.like(haystack text, search text) -> boolean

The implementation would only optimize only if search text is either: %foo% (substring), %foo (suffix), or foo% (prefix) search. Otherwise the implementation would fall back to the Postgres built-in LIKE search automatically.

Possible gotchas:

  • %_foo% would not be supported, since _ means "matches any 1 character"
  • %\_foo% is supported, since the backslash escapes the _.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant