pub struct WindowDefBuilder { /* private fields */ }Expand description
Builder for constructing named WINDOW clause definitions.
Used with SelectBuilder::window() to define reusable window specifications.
Supports PARTITION BY and ORDER BY clauses.
§Examples
use polyglot_sql::builder::*;
let sql = select(["id"])
.from("t")
.window(
"w",
WindowDefBuilder::new()
.partition_by(["dept"])
.order_by([col("salary").desc()]),
)
.to_sql();Implementations§
Source§impl WindowDefBuilder
impl WindowDefBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new, empty window definition builder with no partitioning or ordering.
Sourcepub fn partition_by<I, E>(self, expressions: I) -> Selfwhere
I: IntoIterator<Item = E>,
E: IntoExpr,
pub fn partition_by<I, E>(self, expressions: I) -> Selfwhere
I: IntoIterator<Item = E>,
E: IntoExpr,
Set the PARTITION BY expressions for the window definition.
Auto Trait Implementations§
impl Freeze for WindowDefBuilder
impl RefUnwindSafe for WindowDefBuilder
impl Send for WindowDefBuilder
impl Sync for WindowDefBuilder
impl Unpin for WindowDefBuilder
impl UnwindSafe for WindowDefBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more