Skip to main content

lpad

Function lpad 

Source
pub fn lpad<'a, V, E, L, F>(
    expr: E,
    length: L,
    fill: F,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Text, E::Nullable, <<E::Aggregate as AggOr<L::Aggregate>>::Output as AggOr<F::Aggregate>>::Output>
Expand description

LPAD - pads a string on the left to a specified length (PostgreSQL).

ยงExample

use drizzle_core::expr::lpad;

// SELECT LPAD(users.id::text, 5, '0')  -- zero-pad to 5 digits
let padded = lpad(users.code, 5, "0");