pub enum Expression {
Identifier(Identifier),
Literal(Literal),
Binary {
left: Box<Expression>,
op: BinaryOperator,
right: Box<Expression>,
span: Range<usize>,
},
Unary {
op: UnaryOperator,
expr: Box<Expression>,
span: Range<usize>,
},
FunctionCall {
name: Identifier,
args: Vec<Expression>,
span: Range<usize>,
},
InList {
expr: Box<Expression>,
list: Vec<Expression>,
negated: bool,
span: Range<usize>,
},
Between {
expr: Box<Expression>,
low: Box<Expression>,
high: Box<Expression>,
negated: bool,
span: Range<usize>,
},
Subquery {
query: Box<SelectStatement>,
span: Range<usize>,
},
InSubquery {
expr: Box<Expression>,
query: Box<SelectStatement>,
negated: bool,
span: Range<usize>,
},
Error {
message: Arc<str>,
span: Range<usize>,
},
}Expand description
Represents an SQL expression.
Variants§
Identifier(Identifier)
An identifier expression.
Literal(Literal)
A literal value expression.
Binary
A binary operation expression.
Fields
§
left: Box<Expression>The left-hand side of the binary operation.
§
op: BinaryOperatorThe binary operator.
§
right: Box<Expression>The right-hand side of the binary operation.
Unary
A unary operation expression.
FunctionCall
A function call expression.
Fields
§
name: IdentifierThe name of the function being called.
§
args: Vec<Expression>The arguments passed to the function.
InList
An IN expression.
Fields
§
expr: Box<Expression>The expression being checked.
§
list: Vec<Expression>The list of values to check against.
Between
A BETWEEN expression.
Fields
§
expr: Box<Expression>The expression being checked.
§
low: Box<Expression>The lower bound of the range.
§
high: Box<Expression>The upper bound of the range.
Subquery
A subquery expression.
Fields
§
query: Box<SelectStatement>The subquery SELECT statement.
InSubquery
An IN expression with a subquery.
Fields
§
expr: Box<Expression>The expression being checked.
§
query: Box<SelectStatement>The subquery to check against.
Error
An error occurred during expression parsing or building.
Implementations§
Trait Implementations§
Source§impl AsDocument for Expression
Available on crate feature oak-pretty-print only.
impl AsDocument for Expression
Available on crate feature
oak-pretty-print only.Source§fn as_document(&self) -> Document<'_>
fn as_document(&self) -> Document<'_>
Converts this type to a document for pretty printing.
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Expression
impl Debug for Expression
Source§impl<'de> Deserialize<'de> for Expression
impl<'de> Deserialize<'de> for Expression
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
Source§impl Serialize for Expression
impl Serialize for Expression
Source§impl ToSource for Expression
impl ToSource for Expression
Source§fn to_source(&self, buffer: &mut SourceBuffer)
fn to_source(&self, buffer: &mut SourceBuffer)
Writes the source code representation of this type to the provided buffer.
Source§fn to_source_string(&self) -> String
fn to_source_string(&self) -> String
Converts this type to a source code string.
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnsafeUnpin for Expression
impl UnwindSafe for Expression
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