Builds the patterns of the search queries' LIKE, for the dump, playlist and user searches. A query's % and _ are matched as themselves rather than as wildcards: usernames hold underscores, and "a_b" must not find "axb".

Functions

f
likePattern(
query: string,
where?: "anywhere" | "prefix"
): string

Returns the pattern matching text that contains query, or that starts with it when where is "prefix". The SQL must read LIKE ? ESCAPE '\', which the LIKE fragment spells.

Variables

v
LIKE: "LIKE ? ESCAPE '\\'"

Spells LIKE ? ESCAPE '\', for a likePattern parameter.