instr

Function instr 

Source
pub fn instr<'a, V, E, S>(
    expr: E,
    search: S,
) -> SQLExpr<'a, V, BigInt, E::Nullable, Scalar>
where V: SQLParam + 'a, E: Expr<'a, V>, E::SQLType: Textual, S: Expr<'a, V>, S::SQLType: Textual,
Expand description

INSTR - finds the position of a substring.

Returns the 1-indexed position of the first occurrence of search in the expression, or 0 if not found. Returns BigInt. Preserves the nullability of the input expression.

§Example

use drizzle_core::expr::instr;

// SELECT INSTR(users.email, '@')
let at_pos = instr(users.email, "@");