pub struct CTEHoister { /* private fields */ }
Expand description
CTE Hoister - Analyzes and rewrites nested CTEs
This module implements automatic CTE hoisting to transform nested WITH clauses into a flat list of CTEs at the query’s top level. This enables natural nested query writing while maintaining compatibility with SQL execution.
Example transformation:
-- Input (nested):
SELECT * FROM (
WITH inner_cte AS (SELECT ...)
SELECT * FROM inner_cte
)
-- Output (hoisted):
WITH inner_cte AS (SELECT ...)
SELECT * FROM inner_cte
Implementations§
Source§impl CTEHoister
impl CTEHoister
pub fn new() -> Self
Sourcepub fn hoist_ctes(statement: SelectStatement) -> SelectStatement
pub fn hoist_ctes(statement: SelectStatement) -> SelectStatement
Hoist all nested CTEs to the top level
Auto Trait Implementations§
impl Freeze for CTEHoister
impl RefUnwindSafe for CTEHoister
impl Send for CTEHoister
impl Sync for CTEHoister
impl Unpin for CTEHoister
impl UnwindSafe for CTEHoister
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more