pub struct Window {
pub based_on: Option<Cow<'static, str>>,
pub partition_by: Vec<Expr>,
pub order_by: OrderBy,
pub frame: Frame,
}Expand description
A window definition: what goes inside OVER (…), or after WINDOW name AS.
From PostgreSQL 17, https://www.postgresql.org/docs/17/sql-select.html#SQL-WINDOW:
[ existing_window_name ] [ PARTITION BY expression [, ...] ]
[ ORDER BY expression [ASC | DESC | USING operator] [NULLS {FIRST|LAST}] [, ...] ]
[ frame_clause ]Every part is optional, including all of them at once: OVER () and
WINDOW w AS () are both legal and mean “the whole partition”. So an empty
Window renders the empty string and the parentheses come from whatever
contains it.
Because it holds an OrderBy and a Frame and implements HasOrderBy
and HasFrame, the ordinary order-by and frame mods apply to a window
unchanged.
Fields§
§based_on: Option<Cow<'static, str>>A window this one extends, copying its PARTITION BY and — unless this one
has its own — its ORDER BY. Quoted on output.
partition_by: Vec<Expr>PARTITION BY.
order_by: OrderByORDER BY, which is what gives RANGE frames and rank() a meaning.
frame: FrameThe frame.
Implementations§
Trait Implementations§
Source§impl Expression for Window
impl Expression for Window
Source§impl HasOrderBy for Window
impl HasOrderBy for Window
Source§fn order_by_mut(&mut self) -> &mut OrderBy
fn order_by_mut(&mut self) -> &mut OrderBy
The
ORDER BY clause to modify.Auto Trait Implementations§
impl !RefUnwindSafe for Window
impl !UnwindSafe for Window
impl Freeze for Window
impl Send for Window
impl Sync for Window
impl Unpin for Window
impl UnsafeUnpin for Window
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