pub struct Cte {
pub name: Cow<'static, str>,
pub columns: Vec<Cow<'static, str>>,
pub query: Option<Expr>,
pub materialized: Option<bool>,
pub search: CteSearch,
pub cycle: CteCycle,
}Expand description
One common table expression.
From PostgreSQL 17, https://www.postgresql.org/docs/17/sql-select.html:
with_query_name [ ( column_name [, ...] ) ] AS [ [ NOT ] MATERIALIZED ] ( select | … )
[ SEARCH { BREADTH | DEPTH } FIRST BY column_name [, ...] SET search_seq_col_name ]
[ CYCLE column_name [, ...] SET cycle_mark_col_name
[ TO cycle_mark_value DEFAULT cycle_mark_default ] USING cycle_path_col_name ]The SQL standard allows only a SELECT here; PostgreSQL also allows
INSERT/UPDATE/DELETE, which is why query is an ordinary
expression and not something narrower.
Fields§
§name: Cow<'static, str>The name the rest of the statement refers to. Quoted on output.
columns: Vec<Cow<'static, str>>Column names for the result. Quoted.
query: Option<Expr>The query, rendered inside parentheses.
materialized: Option<bool>MATERIALIZED / NOT MATERIALIZED. None writes neither and leaves the
choice to the planner — which is not the same as either, so this is
genuinely three-valued.
search: CteSearchSEARCH …, for a recursive CTE.
cycle: CteCycleCYCLE …, for a recursive CTE over cyclic data.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Cte
impl !UnwindSafe for Cte
impl Freeze for Cte
impl Send for Cte
impl Sync for Cte
impl Unpin for Cte
impl UnsafeUnpin for Cte
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