pub struct QueryBuilder<T>where
T: TableSchema,{ /* private fields */ }Expand description
A builder for constructing database Queryes.
Implementations§
Source§impl<T> QueryBuilder<T>where
T: TableSchema,
impl<T> QueryBuilder<T>where
T: TableSchema,
Sourcepub fn build(self) -> Query<T>
pub fn build(self) -> Query<T>
Builds and returns a Query object based on the current state of the QueryBuilder.
Sourcepub fn fields<I>(self, fields: I) -> Selfwhere
I: IntoIterator<Item = &'static str>,
pub fn fields<I>(self, fields: I) -> Selfwhere
I: IntoIterator<Item = &'static str>,
Adds multiple fields to select in the query.
Sourcepub fn with(self, table_relation: &str) -> Self
pub fn with(self, table_relation: &str) -> Self
Adds a relation to eagerly load with the main records.
Sourcepub fn order_by_asc(self, field: &str) -> Self
pub fn order_by_asc(self, field: &str) -> Self
Adds an ascending order by clause for the specified field.
Sourcepub fn order_by_desc(self, field: &str) -> Self
pub fn order_by_desc(self, field: &str) -> Self
Adds a descending order by clause for the specified field.
Sourcepub fn filter(self, filter: Option<Filter>) -> Self
pub fn filter(self, filter: Option<Filter>) -> Self
Sets a filter for the query, replacing any existing filter.
Trait Implementations§
Source§impl<T> Clone for QueryBuilder<T>where
T: TableSchema + Clone,
impl<T> Clone for QueryBuilder<T>where
T: TableSchema + Clone,
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 moreSource§impl<T> Debug for QueryBuilder<T>where
T: TableSchema + Debug,
impl<T> Debug for QueryBuilder<T>where
T: TableSchema + Debug,
Source§impl<T> Default for QueryBuilder<T>where
T: TableSchema,
impl<T> Default for QueryBuilder<T>where
T: TableSchema,
Auto 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