better_duck_diesel::dsl::*.
Math and trigonometry
Double -> Double unless noted:
Arithmetic & powers
Arithmetic & powers
abs<T>(x) (generic, preserves the argument type), sqrt, cbrt, pow(base, exponent), exp,
ln, log2, log10, ceil, floor, round, sign.Trigonometry
Trigonometry
sin, cos, tan, asin, acos, atan, atan2(y, x), degrees, radians.Integer math & bitwise
Integer math & bitwise
gcd(a: BigInt, b: BigInt) (→BigInt), lcm(a: BigInt, b: BigInt) (→BigInt),
mod_(a, b) (#[sql_name = "mod"], →BigInt), xor(a, b) (→BigInt),
bit_count(x: BigInt) (→DuckTinyInt).Min / max (generic)
Min / max (generic)
greatest<T>(a, b) and least<T>(a, b) — generic over T, returning the same type.mod_ is spelled with a trailing underscore in Rust and emits mod(...) via #[sql_name = "mod"].
abs, greatest, and least are generic so they preserve the argument’s numeric type rather than
forcing Double.Conditional / null-handling
Generic overT:
UUID generation
All returnDuckUuid (see Type mapping):
gen_random_uuid(), uuidv4(), uuidv7().
Utility
version() (→Text) returns the DuckDB version string; type_of<T>(x)
(#[sql_name = "typeof"], →Text) returns the DuckDB type name of its argument.
See also
String functions
Text transforms, hashing, encoding.
Date & time functions
Temporal extraction and construction.
Aggregates
Statistical and bitwise aggregates.
Type mapping
What
Double / BigInt / DuckUuid load as.