Enum prql_compiler::ir::decl::TableExpr
source · pub enum TableExpr {
RelationVar(Box<Expr>),
LocalTable,
None,
Param(String),
}
Variants§
RelationVar(Box<Expr>)
In SQL, this is a CTE
LocalTable
Actual table in a database. In SQL it can be referred to by name.
None
No expression (this decl just tracks a relation literal).
Param(String)
A placeholder for a relation that will be provided later.
Implementations§
source§impl TableExpr
impl TableExpr
sourcepub fn is_relation_var(&self) -> bool
pub fn is_relation_var(&self) -> bool
Returns true if this is a TableExpr::RelationVar
, otherwise false
sourcepub fn as_relation_var_mut(&mut self) -> Option<&mut Box<Expr>>
pub fn as_relation_var_mut(&mut self) -> Option<&mut Box<Expr>>
Optionally returns mutable references to the inner fields if this is a TableExpr::RelationVar
, otherwise None
sourcepub fn as_relation_var(&self) -> Option<&Box<Expr>>
pub fn as_relation_var(&self) -> Option<&Box<Expr>>
Optionally returns references to the inner fields if this is a TableExpr::RelationVar
, otherwise None
sourcepub fn into_relation_var(self) -> Result<Box<Expr>, TableExpr>
pub fn into_relation_var(self) -> Result<Box<Expr>, TableExpr>
Returns the inner fields if this is a TableExpr::RelationVar
, otherwise returns back the enum in the Err
case of the result
sourcepub fn is_local_table(&self) -> bool
pub fn is_local_table(&self) -> bool
Returns true if this is a TableExpr::LocalTable
, otherwise false
sourcepub fn as_param_mut(&mut self) -> Option<&mut String>
pub fn as_param_mut(&mut self) -> Option<&mut String>
Optionally returns mutable references to the inner fields if this is a TableExpr::Param
, otherwise None
sourcepub fn as_param(&self) -> Option<&String>
pub fn as_param(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a TableExpr::Param
, otherwise None
sourcepub fn into_param(self) -> Result<String, TableExpr>
pub fn into_param(self) -> Result<String, TableExpr>
Returns the inner fields if this is a TableExpr::Param
, otherwise returns back the enum in the Err
case of the result