Skip to main content

left

Function left 

Source
pub fn left<'a, V, E, N>(
    expr: E,
    n: N,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Text, E::Nullable, <E::Aggregate as AggOr<N::Aggregate>>::Output>
Expand description

LEFT - returns the first n characters of a string (PostgreSQL).

Preserves the nullability of the input expression.

ยงExample

use drizzle_core::expr::left;

// SELECT LEFT(users.name, 3)
let prefix = left(users.name, 3);