pub struct QueryBuilder { /* private fields */ }
Expand description
Simple query builder for common operations
Implementations§
Source§impl QueryBuilder
impl QueryBuilder
pub fn new(table: &str) -> Self
pub fn select(self, fields: &[&str]) -> Self
pub fn where_eq(self, field: &str, value: &str) -> Self
pub fn where_like(self, field: &str, pattern: &str) -> Self
pub fn order_by(self, field: &str, direction: &str) -> Self
pub fn limit(self, limit: u64) -> Self
pub fn offset(self, offset: u64) -> Self
pub fn build_select(&self) -> String
pub fn build_insert(&self, data: &HashMap<String, String>) -> String
pub fn build_update(&self, data: &HashMap<String, String>) -> String
pub fn build_delete(&self) -> String
Auto Trait Implementations§
impl Freeze for QueryBuilder
impl RefUnwindSafe for QueryBuilder
impl Send for QueryBuilder
impl Sync for QueryBuilder
impl Unpin 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