pub struct ChooseNode {
pub when_nodes: Vec<NodeType>,
pub otherwise_node: Option<Box<NodeType>>,
}
Expand description
Represents a choose
node in py_sql.
It provides a way to conditionally execute different blocks of SQL, similar to a switch statement.
It must contain one or more when
child nodes and can optionally have an otherwise
child node.
§Example
PySQL syntax:
choose:
when test="type == 'A'":
sql_block_A
when test="type == 'B'":
sql_block_B
otherwise:
sql_block_default
Fields§
§when_nodes: Vec<NodeType>
§otherwise_node: Option<Box<NodeType>>
Trait Implementations§
Source§impl Clone for ChooseNode
impl Clone for ChooseNode
Source§fn clone(&self) -> ChooseNode
fn clone(&self) -> ChooseNode
Returns a copy 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 ChooseNode
impl Debug for ChooseNode
Source§impl PartialEq for ChooseNode
impl PartialEq for ChooseNode
impl Eq for ChooseNode
impl StructuralPartialEq for ChooseNode
Auto Trait Implementations§
impl Freeze for ChooseNode
impl RefUnwindSafe for ChooseNode
impl Send for ChooseNode
impl Sync for ChooseNode
impl Unpin for ChooseNode
impl UnwindSafe for ChooseNode
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,
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.