pub struct QueryBuilder { /* private fields */ }Expand description
查询构建器
Implementations§
Source§impl QueryBuilder
impl QueryBuilder
pub fn new(table: String, engine: Arc<RwLock<MemoryEngine>>) -> Self
pub fn eq(self, field: &str, value: DbValue) -> Self
pub fn ne(self, field: &str, value: DbValue) -> Self
pub fn lt(self, field: &str, value: DbValue) -> Self
pub fn le(self, field: &str, value: DbValue) -> Self
pub fn gt(self, field: &str, value: DbValue) -> Self
pub fn ge(self, field: &str, value: DbValue) -> Self
pub fn in_list(self, field: &str, values: Vec<DbValue>) -> Self
pub fn contains(self, field: &str, value: &str) -> Self
pub fn and(self, other: QueryBuilder) -> Self
pub fn order_by(self, field: &str, order: Order) -> Self
pub fn limit(self, limit: usize) -> Self
pub fn offset(self, offset: usize) -> Self
pub fn inner_join( self, right_table: &str, left_field: &str, right_field: &str, ) -> Self
pub fn left_join( self, right_table: &str, left_field: &str, right_field: &str, ) -> Self
pub fn right_join( self, right_table: &str, left_field: &str, right_field: &str, ) -> Self
pub fn full_join( self, right_table: &str, left_field: &str, right_field: &str, ) -> Self
pub fn select(self, columns: &[&str]) -> Self
Sourcepub fn count_column(self, column: &str) -> Self
pub fn count_column(self, column: &str) -> Self
COUNT(column) - 统计非 NULL 行数
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