Skip to main content

escape_like_query

Function escape_like_query 

Source
pub fn escape_like_query(query: &str) -> String
Expand description

Escapes the escape character itself and the wildcard characters for SQL LIKE queries.

The pattern assumes \ as the escape character. MySQL and PostgreSQL use it by default, but SQLite has no default escape character, so callers building their own condition must pair the pattern with ESCAPE '\' (e.g. via [sea_orm::sea_query::LikeExpr::escape]) for the pattern to mean the same thing on every backend.