pub struct QueryBuilder<T> { /* private fields */ }Expand description
Implementations§
Source§impl<T: ClickTable> QueryBuilder<T>
impl<T: ClickTable> QueryBuilder<T>
Sourcepub fn select<C: TypedColumn<Table = T>>(self, _col: C) -> Self
pub fn select<C: TypedColumn<Table = T>>(self, _col: C) -> Self
Add a typed column to the SELECT clause.
Sourcepub fn select_raw(self, expr: impl Into<String>) -> Self
pub fn select_raw(self, expr: impl Into<String>) -> Self
Add a raw expression string to the SELECT clause.
Useful for aggregate functions like count(), sum(field), etc.
Sourcepub fn join<T2: ClickTable, J: JoinType>(
self,
join_spec: JoinSpec<T, T2, J>,
) -> Self
pub fn join<T2: ClickTable, J: JoinType>( self, join_spec: JoinSpec<T, T2, J>, ) -> Self
Sourcepub fn filter<C: TypedColumn<Table = T>, V: SqlValue>(
self,
_col: C,
op: Operator,
value: V,
) -> Self
pub fn filter<C: TypedColumn<Table = T>, V: SqlValue>( self, _col: C, op: Operator, value: V, ) -> Self
Sourcepub fn filter_raw(self, condition: impl Into<String>) -> Self
pub fn filter_raw(self, condition: impl Into<String>) -> Self
Add a raw WHERE condition string.
Sourcepub fn order_by<C: TypedColumn<Table = T>>(self, _col: C, desc: bool) -> Self
pub fn order_by<C: TypedColumn<Table = T>>(self, _col: C, desc: bool) -> Self
Add an ORDER BY clause for a specific column.
Sourcepub fn order_by_raw(self, expr: impl Into<String>) -> Self
pub fn order_by_raw(self, expr: impl Into<String>) -> Self
Add a raw string to the ORDER BY clause.
Sourcepub fn group_by<C: TypedColumn<Table = T>>(self, _col: C) -> Self
pub fn group_by<C: TypedColumn<Table = T>>(self, _col: C) -> Self
Add a GROUP BY clause for a typed column.
Sourcepub fn group_by_raw(self, expr: impl Into<String>) -> Self
pub fn group_by_raw(self, expr: impl Into<String>) -> Self
Add a raw string to the GROUP BY clause.
Trait Implementations§
Source§impl<T: Clone> Clone for QueryBuilder<T>
impl<T: Clone> Clone for QueryBuilder<T>
Source§fn clone(&self) -> QueryBuilder<T>
fn clone(&self) -> QueryBuilder<T>
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 moreAuto Trait Implementations§
impl<T> Freeze for QueryBuilder<T>
impl<T> RefUnwindSafe for QueryBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for QueryBuilder<T>where
T: Send,
impl<T> Sync for QueryBuilder<T>where
T: Sync,
impl<T> Unpin for QueryBuilder<T>where
T: Unpin,
impl<T> UnwindSafe for QueryBuilder<T>where
T: UnwindSafe,
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