pub struct Query {
pub with: Option<With>,
pub body: SetExpr,
pub order_by: Vec<OrderByExpr>,
pub limit: Option<Limit>,
pub pipes: Vec<PipeOperator>,
}Expand description
A query: an optional WITH, a body, ORDER BY/LIMIT, then any pipe operators.
Fields§
§with: Option<With>§body: SetExpr§order_by: Vec<OrderByExpr>§limit: Option<Limit>§pipes: Vec<PipeOperator>Implementations§
Source§impl Query
impl Query
Sourcepub fn walk_exprs(&self, f: impl FnMut(&Expr))
pub fn walk_exprs(&self, f: impl FnMut(&Expr))
Call f on every expression of the query, subqueries included.
Sourcepub fn walk_selects(&self, f: impl FnMut(&Select))
pub fn walk_selects(&self, f: impl FnMut(&Select))
Call f on every SELECT of the query, subqueries and CTEs included.
Sourcepub fn referenced_tables(&self) -> Vec<TableName>
pub fn referenced_tables(&self) -> Vec<TableName>
The tables the query reads, in first-seen order and without duplicates. A name bound by a
WITH in scope at the reference is a CTE, not a table (a recursive CTE sees itself).
Sourcepub fn output_names(&self) -> Option<Vec<String>>
pub fn output_names(&self) -> Option<Vec<String>>
The names of the query’s output columns, when every one is known (no *).
Sourcepub fn first_select_mut(&mut self) -> Option<&mut Select>
pub fn first_select_mut(&mut self) -> Option<&mut Select>
The first SELECT of the body, through set operations and parentheses.
Sourcepub fn visit_tables_mut(&mut self, f: &mut dyn FnMut(&mut TableFactor, bool))
pub fn visit_tables_mut(&mut self, f: &mut dyn FnMut(&mut TableFactor, bool))
Mutable access to every table reference with whether a CTE in scope binds its name.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Query
impl<'de> Deserialize<'de> for Query
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Query
impl StructuralPartialEq for Query
Auto Trait Implementations§
impl Forget for Query
impl Freeze for Querywhere
*const u8 is !null: Freeze,
PhantomData<Cte>: Freeze,
*const Select is !null: Freeze,
PhantomData<Select>: Freeze,
*const Query is !null: Freeze,
PhantomData<Query>: Freeze,
PhantomData<Ident>: Freeze,
*const SetExpr is !null: Freeze,
PhantomData<SetExpr>: Freeze,
PhantomData<TableWithJoins>: Freeze,
PhantomData<OrderByExpr>: Freeze,
PhantomData<u8>: Freeze,
*const Expr is !null: Freeze,
PhantomData<Expr>: Freeze,
*const DataType is !null: Freeze,
PhantomData<DataType>: Freeze,
PhantomData<CaseWhen>: Freeze,
PhantomData<StructField>: Freeze,
PhantomData<StructExprField>: Freeze,
*const Function is !null: Freeze,
PhantomData<Function>: Freeze,
PhantomData<(Ident, Expr)>: Freeze,
PhantomData<PipeOperator>: Freeze,
impl Move for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin for Querywhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Cte>: UnsafeUnpin,
*const Select is !null: UnsafeUnpin,
PhantomData<Select>: UnsafeUnpin,
*const Query is !null: UnsafeUnpin,
PhantomData<Query>: UnsafeUnpin,
PhantomData<Ident>: UnsafeUnpin,
*const SetExpr is !null: UnsafeUnpin,
PhantomData<SetExpr>: UnsafeUnpin,
PhantomData<TableWithJoins>: UnsafeUnpin,
PhantomData<OrderByExpr>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const Expr is !null: UnsafeUnpin,
PhantomData<Expr>: UnsafeUnpin,
*const DataType is !null: UnsafeUnpin,
PhantomData<DataType>: UnsafeUnpin,
PhantomData<CaseWhen>: UnsafeUnpin,
PhantomData<StructField>: UnsafeUnpin,
PhantomData<StructExprField>: UnsafeUnpin,
*const Function is !null: UnsafeUnpin,
PhantomData<Function>: UnsafeUnpin,
PhantomData<(Ident, Expr)>: UnsafeUnpin,
PhantomData<PipeOperator>: UnsafeUnpin,
impl UnwindSafe for Querywhere
RawVecInner: UnwindSafe,
BoxRaw<Query>: UnwindSafe,
BoxRaw<Select>: UnwindSafe,
BoxRaw<SetExpr>: UnwindSafe,
BoxRaw<Expr>: UnwindSafe,
BoxRaw<DataType>: UnwindSafe,
BoxRaw<Function>: UnwindSafe,
BoxRaw<TableWithJoins>: UnwindSafe,
BoxRaw<TableFactor>: UnwindSafe,
BoxRaw<MatchRecognize>: UnwindSafe,
BoxRaw<Align>: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.