pub struct QueryBuilder { /* private fields */ }Expand description
Builder for SQL queries.
Implementations§
Source§impl QueryBuilder
impl QueryBuilder
Sourcepub fn insert_into(self, table: &str) -> Self
pub fn insert_into(self, table: &str) -> Self
Start an INSERT query.
Sourcepub fn delete_from(self, table: &str) -> Self
pub fn delete_from(self, table: &str) -> Self
Start a DELETE query.
Sourcepub fn where_gte(self, column: &str, value: impl Into<Value>) -> Self
pub fn where_gte(self, column: &str, value: impl Into<Value>) -> Self
Add a WHERE >= condition.
Sourcepub fn where_lte(self, column: &str, value: impl Into<Value>) -> Self
pub fn where_lte(self, column: &str, value: impl Into<Value>) -> Self
Add a WHERE <= condition.
Sourcepub fn where_like(self, column: &str, pattern: &str) -> Self
pub fn where_like(self, column: &str, pattern: &str) -> Self
Add a WHERE LIKE condition.
Sourcepub fn where_null(self, column: &str) -> Self
pub fn where_null(self, column: &str) -> Self
Add a WHERE IS NULL condition.
Sourcepub fn where_not_null(self, column: &str) -> Self
pub fn where_not_null(self, column: &str) -> Self
Add a WHERE IS NOT NULL condition.
Sourcepub fn right_join(self, table: &str, on: &str) -> Self
pub fn right_join(self, table: &str, on: &str) -> Self
Add a RIGHT JOIN clause.
Sourcepub fn order_by(self, column: &str, direction: OrderDirection) -> Self
pub fn order_by(self, column: &str, direction: OrderDirection) -> Self
Add an ORDER BY clause.
Sourcepub fn order_by_asc(self, column: &str) -> Self
pub fn order_by_asc(self, column: &str) -> Self
Add ascending ORDER BY.
Sourcepub fn order_by_desc(self, column: &str) -> Self
pub fn order_by_desc(self, column: &str) -> Self
Add descending ORDER BY.
Trait Implementations§
Source§impl Clone for QueryBuilder
impl Clone for QueryBuilder
Source§fn clone(&self) -> QueryBuilder
fn clone(&self) -> QueryBuilder
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 QueryBuilder
impl Debug for QueryBuilder
Source§impl Default for QueryBuilder
impl Default for QueryBuilder
Source§fn default() -> QueryBuilder
fn default() -> QueryBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for QueryBuilder
impl RefUnwindSafe for QueryBuilder
impl Send for QueryBuilder
impl Sync for QueryBuilder
impl Unpin for QueryBuilder
impl UnsafeUnpin for QueryBuilder
impl UnwindSafe for QueryBuilder
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