pub fn collate<'a, V, E>(
expr: E,
name: &'static str,
) -> SQLExpr<'a, V, E::SQLType, E::Nullable, E::Aggregate, E::Sources>Expand description
Applies a collation to a text expression (expr COLLATE "name").
Renders (expr COLLATE "name"), with the name quoted as an identifier,
which both SQLite and PostgreSQL accept. The argument must be text. The
result keeps its SQL type, nullability and aggregate kind. Use it in a
comparison for case-insensitive matching, or in ORDER BY.
ยงExamples
// Case-insensitive comparison on SQLite.
let cond = eq(collate(users.name, "NOCASE"), "alice");
assert_eq!(cond.sql(), r#"("users"."name" COLLATE "NOCASE")= ?"#);