abs

Function abs 

Source
pub fn abs<'a, V, E>(expr: E) -> SQLExpr<'a, V, E::SQLType, E::Nullable, Scalar>
where V: SQLParam + 'a, E: Expr<'a, V>, E::SQLType: Numeric,
Expand description

ABS - returns the absolute value of a number.

Preserves the SQL type and nullability of the input expression.

ยงType Safety

โ“˜
// โœ… OK: Int column
abs(users.balance);

// โŒ Compile error: Text is not Numeric
abs(users.name);