pub fn sqrt<'a, V, E>(
expr: E,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Double, <V::DialectMarker as DialectTypes>::DomainNullable<E::Nullable>, E::Aggregate, E::Sources>Expand description
Square root (SQRT).
The argument must be numeric. The result is the dialect’s double type. On
SQLite and MySQL a negative argument gives NULL, so the result is
nullable there; PostgreSQL raises an error instead and keeps the
argument’s nullability. On SQLite this needs the math feature.
§Examples
assert_eq!(
sqrt(users.score).sql(),
r#"CAST (SQRT ("users"."score") AS DOUBLE PRECISION)"#
);