Function substr
Source pub fn substr<'a, V, E, S, L>(
expr: E,
start: S,
len: L,
) -> SQLExpr<'a, V, Text, E::Nullable, Scalar>
Expand description
SUBSTR - extracts a substring from a string.
Extracts len characters starting at position start (1-indexed).
Preserves the nullability of the input expression.
§Example
ⓘuse drizzle_core::expr::substr;
let prefix = substr(users.name, 1, 3);