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>where
V: SQLParam + 'a,
V::DialectMarker: PostgresStringSupport,
E: Expr<'a, V>,
E::SQLType: Textual,
L: Expr<'a, V>,
L::SQLType: Integral,
L::Aggregate: AggregateKind,
F: Expr<'a, V>,
F::SQLType: Textual,
F::Aggregate: AggregateKind,
E::Aggregate: AggOr<L::Aggregate>,
<E::Aggregate as AggOr<L::Aggregate>>::Output: AggOr<F::Aggregate>,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");