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".
f
likePattern(): string
query: string,
where?: "anywhere" | "prefix"
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.
v
LIKE: "LIKE ? ESCAPE '\\'"
Spells LIKE ? ESCAPE '\', for a likePattern parameter.
Usage
import * as mod from "api/lib/like.ts";