pub fn instr<'a, V, E, S>(
expr: E,
search: S,
) -> SQLExpr<'a, V, Integer, E::Nullable, <E::Aggregate as AggOr<S::Aggregate>>::Output>where
V: SQLParam + 'a,
V::DialectMarker: SQLiteStringSupport,
E: Expr<'a, V>,
E::SQLType: Textual,
S: Expr<'a, V>,
S::SQLType: Textual,
S::Aggregate: AggregateKind,
E::Aggregate: AggOr<S::Aggregate>,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 SQLite INTEGER.
Preserves the nullability of the input expression.
ยงExample
use drizzle_core::expr::instr;
// SELECT INSTR(users.email, '@')
let at_pos = instr(users.email, "@");