pub struct FuncExpr { /* private fields */ }Expand description
A function call under construction: f("row_number", ()).over(window).
Expr::Func carries the optional OVER window, but OVER is only
meaningful on a function call, so the method that sets it lives here rather
than on Expr — where it would have to either silently do nothing or panic
for the fifteen other variants.
A FuncExpr is an Expression and an IntoExpr, so it can be used
wherever an expression is expected without being finished first. Call
IntoExpr::into_expr to get the Expr and continue with the operator
chain.
The richer function forms — DISTINCT, FILTER (WHERE ..),
WITHIN GROUP (..), column definition lists — differ per dialect, and belong
to that dialect’s own function builder. It reaches core as
Expr::Custom.
Implementations§
Source§impl FuncExpr
impl FuncExpr
Sourcepub fn new(
name: impl Into<Cow<'static, str>>,
args: impl IntoExprList,
) -> FuncExpr
pub fn new( name: impl Into<Cow<'static, str>>, args: impl IntoExprList, ) -> FuncExpr
A function call: name(args..).
Sourcepub fn over(self, window: impl IntoExpr) -> Expr
pub fn over(self, window: impl IntoExpr) -> Expr
Attach a window: name(args..) OVER (window).
The window may be a definition or the name of one declared in a WINDOW
clause; both render inside the same parentheses. An empty expression gives
the valid and occasionally useful OVER ().
Ends the builder, because there is nothing further to configure.