pub struct WindowSpec {
pub func: WindowFuncKind,
pub column: Option<String>,
pub partition_by: Vec<String>,
pub order_by: Vec<(String, OrderDirection)>,
pub alias: String,
}Expand description
Specification for a window function projection.
Mirrors the design of [super::ast::HavingExpr]: a structured AST node
stored in super::state::QueryState and compiled to SQL at generation
time so that dialect-specific identifier quoting is applied consistently.
Fields§
§func: WindowFuncKindThe window function to apply.
column: Option<String>The column argument (required for aggregate/offset functions, ignored for ranking functions).
partition_by: Vec<String>PARTITION BY columns (empty for no partitioning).
order_by: Vec<(String, OrderDirection)>ORDER BY within the window frame.
alias: StringThe output column alias (emitted as AS <alias>).
Implementations§
Source§impl WindowSpec
impl WindowSpec
Sourcepub fn to_sql(&self, gen: &dyn ISqlGenerator) -> String
pub fn to_sql(&self, gen: &dyn ISqlGenerator) -> String
Compiles this window function into a SELECT-list projection fragment using the provider’s identifier quoting.
Ranking functions emit FUNC() OVER (...); aggregate/offset functions
emit FUNC(col) OVER (...). The alias is always appended.
Trait Implementations§
Source§impl Clone for WindowSpec
impl Clone for WindowSpec
Source§fn clone(&self) -> WindowSpec
fn clone(&self) -> WindowSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 WindowSpec
impl RefUnwindSafe for WindowSpec
impl Send for WindowSpec
impl Sync for WindowSpec
impl Unpin for WindowSpec
impl UnsafeUnpin for WindowSpec
impl UnwindSafe for WindowSpec
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