Struct proof_of_sql_parser::SelectStatement
source · pub struct SelectStatement {
pub expr: Box<SetExpression>,
pub order_by: Vec<OrderBy>,
pub slice: Option<Slice>,
}
Expand description
Representation of a select statement, that is, the only type of queries allowed.
Fields§
§expr: Box<SetExpression>
the query expression
order_by: Vec<OrderBy>
if non-empty, an sort-order that is applied to the rows returned as result
slice: Option<Slice>
an optional slice clause, which can restrict the rows returned to a window within the
set of rows as generated by expr
and order_by
.
Implementations§
source§impl SelectStatement
impl SelectStatement
sourcepub fn get_table_references(
&self,
default_schema: Identifier,
) -> Vec<ResourceId>
pub fn get_table_references( &self, default_schema: Identifier, ) -> Vec<ResourceId>
This function returns the referenced tables in the provided intermediate_ast
Note that we provide a default_schema
in case the table expression
does not have any associated schema. This default_schema
is
used to construct the resource_id, as we cannot have this field empty.
In case the table expression already has an associated schema,
then it’s used instead of default_schema
. Although the DQL endpoint
would require both to be equal, we have chosen to not fail here
as this would imply the caller to always know beforehand the referenced
schemas.
Return:
- The vector with all tables referenced by the intermediate ast, encoded as resource ids.
Trait Implementations§
source§impl Clone for SelectStatement
impl Clone for SelectStatement
source§fn clone(&self) -> SelectStatement
fn clone(&self) -> SelectStatement
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SelectStatement
impl Debug for SelectStatement
source§impl<'de> Deserialize<'de> for SelectStatement
impl<'de> Deserialize<'de> for SelectStatement
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>,
source§impl FromStr for SelectStatement
impl FromStr for SelectStatement
§type Err = ParseError
type Err = ParseError
source§impl PartialEq for SelectStatement
impl PartialEq for SelectStatement
source§impl Serialize for SelectStatement
impl Serialize for SelectStatement
impl Eq for SelectStatement
impl StructuralPartialEq for SelectStatement
Auto Trait Implementations§
impl Freeze for SelectStatement
impl RefUnwindSafe for SelectStatement
impl Send for SelectStatement
impl Sync for SelectStatement
impl Unpin for SelectStatement
impl UnwindSafe for SelectStatement
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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
key
and return true
if they are equal.