pub struct OptimizedWindowSpec {
pub partition_by: PartitionByList,
pub order_by: SmallVec<[(Identifier, SortOrder); 4]>,
pub frame: Option<WindowFrame>,
pub window_ref: Option<Identifier>,
}Expand description
An optimized window specification using SmallVec for partition/order columns.
This is a more memory-efficient version of WindowSpec that uses
stack-allocated small vectors for typical use cases.
Fields§
§partition_by: PartitionByListPartition columns (typically 1-4).
order_by: SmallVec<[(Identifier, SortOrder); 4]>Order by columns with direction (typically 1-4).
frame: Option<WindowFrame>Frame type.
window_ref: Option<Identifier>Reference to a named window.
Implementations§
Source§impl OptimizedWindowSpec
impl OptimizedWindowSpec
Sourcepub fn partition_by<I, S>(self, columns: I) -> Self
pub fn partition_by<I, S>(self, columns: I) -> Self
Add partition by columns.
Sourcepub fn partition_by_col(self, column: impl Into<Identifier>) -> Self
pub fn partition_by_col(self, column: impl Into<Identifier>) -> Self
Add a single partition column.
Sourcepub fn order_by(self, column: impl Into<Identifier>, order: SortOrder) -> Self
pub fn order_by(self, column: impl Into<Identifier>, order: SortOrder) -> Self
Add order by column with sort direction.
Sourcepub fn rows(self, start: FrameBound, end: Option<FrameBound>) -> Self
pub fn rows(self, start: FrameBound, end: Option<FrameBound>) -> Self
Set frame to ROWS BETWEEN … AND …
Sourcepub fn rows_unbounded_preceding(self) -> Self
pub fn rows_unbounded_preceding(self) -> Self
Set frame to ROWS UNBOUNDED PRECEDING.
Sourcepub fn window_ref(self, name: impl Into<Identifier>) -> Self
pub fn window_ref(self, name: impl Into<Identifier>) -> Self
Set a reference to a named window.
Sourcepub fn to_sql(&self, _db_type: DatabaseType) -> String
pub fn to_sql(&self, _db_type: DatabaseType) -> String
Generate SQL for the OVER clause.
Trait Implementations§
Source§impl Clone for OptimizedWindowSpec
impl Clone for OptimizedWindowSpec
Source§fn clone(&self) -> OptimizedWindowSpec
fn clone(&self) -> OptimizedWindowSpec
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 moreSource§impl Debug for OptimizedWindowSpec
impl Debug for OptimizedWindowSpec
Source§impl Default for OptimizedWindowSpec
impl Default for OptimizedWindowSpec
Source§fn default() -> OptimizedWindowSpec
fn default() -> OptimizedWindowSpec
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OptimizedWindowSpec
impl RefUnwindSafe for OptimizedWindowSpec
impl Send for OptimizedWindowSpec
impl Sync for OptimizedWindowSpec
impl Unpin for OptimizedWindowSpec
impl UnwindSafe for OptimizedWindowSpec
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