pub struct WindowBuilder { /* private fields */ }Expand description
Builder for window functions with OVER clause.
Implementations§
Source§impl WindowBuilder
impl WindowBuilder
Sourcepub fn partition_by(self, expr: impl Into<Expr>) -> Self
pub fn partition_by(self, expr: impl Into<Expr>) -> Self
Add a PARTITION BY expression.
Can be called multiple times to partition by multiple columns.
Sourcepub fn partition_by_many(self, exprs: Vec<impl Into<Expr>>) -> Self
pub fn partition_by_many(self, exprs: Vec<impl Into<Expr>>) -> Self
Add multiple PARTITION BY expressions at once.
Sourcepub fn order_by(self, order: OrderBy) -> Self
pub fn order_by(self, order: OrderBy) -> Self
Add an ORDER BY clause within the window.
Can be called multiple times to order by multiple columns.
Sourcepub fn order_by_asc(self, expr: impl Into<Expr>) -> Self
pub fn order_by_asc(self, expr: impl Into<Expr>) -> Self
Add ORDER BY with ascending direction.
Sourcepub fn order_by_desc(self, expr: impl Into<Expr>) -> Self
pub fn order_by_desc(self, expr: impl Into<Expr>) -> Self
Add ORDER BY with descending direction.
Sourcepub fn rows_between(
self,
start: WindowFrameBound,
end: WindowFrameBound,
) -> Self
pub fn rows_between( self, start: WindowFrameBound, end: WindowFrameBound, ) -> Self
Sourcepub fn rows(self, start: WindowFrameBound) -> Self
pub fn rows(self, start: WindowFrameBound) -> Self
Sourcepub fn range_between(
self,
start: WindowFrameBound,
end: WindowFrameBound,
) -> Self
pub fn range_between( self, start: WindowFrameBound, end: WindowFrameBound, ) -> Self
Sourcepub fn range(self, start: WindowFrameBound) -> Self
pub fn range(self, start: WindowFrameBound) -> Self
Set frame specification: RANGE start (no end bound).
Sourcepub fn groups_between(
self,
start: WindowFrameBound,
end: WindowFrameBound,
) -> Self
pub fn groups_between( self, start: WindowFrameBound, end: WindowFrameBound, ) -> Self
Set frame specification: GROUPS BETWEEN start AND end (PostgreSQL 11+).
Trait Implementations§
Source§impl Clone for WindowBuilder
impl Clone for WindowBuilder
Source§fn clone(&self) -> WindowBuilder
fn clone(&self) -> WindowBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WindowBuilder
impl RefUnwindSafe for WindowBuilder
impl Send for WindowBuilder
impl Sync for WindowBuilder
impl Unpin for WindowBuilder
impl UnsafeUnpin for WindowBuilder
impl UnwindSafe for WindowBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).