Function left
Source pub fn left<'a, V, E, N>(
expr: E,
n: N,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Text, <E::Nullable as Nullability>::Or<N::Nullable>, <E::Aggregate as AggregateKind>::Or<N::Aggregate>, (E::Sources, N::Sources)>where
V:
SQLParam + 'a,
V::
DialectMarker:
DialectSupports<
LeftRight>,
E:
Expr<'a, V>,
E::
SQLType:
Textual,
N:
Expr<'a, V>,
N::
SQLType:
Integral,
N::
Nullable:
Nullability,
N::
Aggregate:
AggregateKind,
Expand description
The first n characters of a text value (LEFT), on PostgreSQL and MySQL.
expr must be text and n an integer. The result is text, nullable if
either argument is. SQLite has no LEFT; use substr there.
ยงExamples
assert_eq!(left(users.name, 3).sql(), r#"LEFT ("users"."name", $1)"#);