pub struct WhenNode {
pub childs: Vec<NodeType>,
pub test: String,
}
Expand description
Represents a when
node in py_sql.
It’s used as a child of a choose
node to define a conditional block of SQL.
The SQL block within when
is executed if its test
condition evaluates to true and no preceding when
in the same choose
was true.
§Attributes
test
: The boolean expression to evaluate.
§Example
PySQL syntax (inside a choose
block):
choose:
when test="type == 'A'":
sql_for_type_A
when test="type == 'B'":
sql_for_type_B
Fields§
§childs: Vec<NodeType>
§test: String
Trait Implementations§
impl Eq for WhenNode
impl StructuralPartialEq for WhenNode
Auto Trait Implementations§
impl Freeze for WhenNode
impl RefUnwindSafe for WhenNode
impl Send for WhenNode
impl Sync for WhenNode
impl Unpin for WhenNode
impl UnwindSafe for WhenNode
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.