Shared LIKE/ILIKE search-term escaping for contexts that filter by a
free-text search box (Contacts, Companies, PartyRoles, Lists).
Summary
Functions
Wraps a trimmed search term in %…%, escaping the LIKE/ILIKE
metacharacters (\, %, _) so a literal % or _ in the term
matches itself rather than acting as a wildcard. Postgres ILIKE uses
backslash as the default escape character.