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 _.
This is a possible proposal to implement:
stringtheory.like(haystack text, search text) -> booleanThe implementation would only optimize only if search text is either:
%foo%(substring),%foo(suffix), orfoo%(prefix) search. Otherwise the implementation would fall back to the Postgres built-inLIKEsearch automatically.Possible gotchas:
%_foo%would not be supported, since_means "matches any 1 character"%\_foo%is supported, since the backslash escapes the_.