Skip to main content

ilike

Function ilike 

Source
pub fn ilike<'a, E, P>(
    expr: E,
    pattern: P,
) -> SQLExpr<'a, PostgresValue<'a>, Boolean, NonNull, Scalar>
where E: Expr<'a, PostgresValue<'a>>, P: Into<PostgresValue<'a>>,
Expand description

Case-insensitive LIKE pattern matching (PostgreSQL-specific)

The result is a boolean expression, so it can be used directly in WHERE, HAVING and join conditions.

ยงExample

let name = SQL::<PostgresValue>::raw("name");
let cond = ilike(name, "%john%");
assert!(cond.to_sql().sql().contains("ILIKE"));