pub struct DatabaseQuery<M> { /* private fields */ }Expand description
High-level typed select builder bound to a database.
Implementations§
Source§impl<M: Model> DatabaseQuery<M>
impl<M: Model> DatabaseQuery<M>
pub fn new(query: SelectQuery<M>) -> Self
pub fn filter(self, expr: Expr) -> Self
pub fn order_by(self, order: OrderBy) -> Self
pub fn limit(self, limit: u64) -> Self
pub fn offset(self, offset: u64) -> Self
Loads one foreign-key relation without per-row queries.
Loads a reverse foreign-key relation with one batched query.
pub async fn all(self, database: &Database) -> Result<Vec<M>, OrmError>where
M: Send + 'static,
pub async fn first(self, database: &Database) -> Result<Option<M>, OrmError>where
M: Send + 'static,
pub async fn count(self, database: &Database) -> Result<usize, OrmError>where
M: Send + 'static,
pub fn into_select_query(self) -> SelectQuery<M>
Auto Trait Implementations§
impl<M> Freeze for DatabaseQuery<M>
impl<M> RefUnwindSafe for DatabaseQuery<M>where
M: RefUnwindSafe,
impl<M> Send for DatabaseQuery<M>where
M: Send,
impl<M> Sync for DatabaseQuery<M>where
M: Sync,
impl<M> Unpin for DatabaseQuery<M>where
M: Unpin,
impl<M> UnsafeUnpin for DatabaseQuery<M>
impl<M> UnwindSafe for DatabaseQuery<M>where
M: 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