pub struct WhereNode {
pub childs: Vec<NodeType>,
}
Expand description
Represents a where
node in py_sql.
It’s used to dynamically build the WHERE
clause of a SQL query.
It will automatically prepend WHERE
if needed and remove leading AND
or OR
keywords from its content.
§Example
PySQL syntax:
SELECT * FROM table
where:
if id != null:
AND id = #{id}
if name != null:
AND name = #{name}
This would result in SELECT * FROM table WHERE id = #{id} AND name = #{name}
(if both conditions are true),
or SELECT * FROM table WHERE id = #{id}
(if only id is not null),
or SELECT * FROM table WHERE name = #{name}
(if only name is not null).
If no conditions are met, the WHERE
clause is omitted entirely.
Fields§
§childs: Vec<NodeType>
Trait Implementations§
impl Eq for WhereNode
impl StructuralPartialEq for WhereNode
Auto Trait Implementations§
impl Freeze for WhereNode
impl RefUnwindSafe for WhereNode
impl Send for WhereNode
impl Sync for WhereNode
impl Unpin for WhereNode
impl UnwindSafe for WhereNode
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.