pub struct BoundQuery<'db, Q> { /* private fields */ }Expand description
A query bound to the database that created it.
Created by Database::query. Execution methods use that same database,
including its configured runtime. Standalone DatabaseQuery values remain
independent and accept an explicit database when executed.
Implementations§
Source§impl<'db, M: Model> BoundQuery<'db, DatabaseQuery<M>>
impl<'db, M: Model> BoundQuery<'db, DatabaseQuery<M>>
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
pub async fn all(self) -> Result<Vec<M>, OrmError>where
M: Send + 'static,
pub async fn first(self) -> Result<Option<M>, OrmError>where
M: Send + 'static,
pub async fn count(self) -> Result<usize, OrmError>where
M: Send + 'static,
pub fn into_select_query(self) -> SelectQuery<M>
Source§impl<M: Model, R, Relation, Key> BoundQuery<'_, SelectRelatedQuery<M, R, Relation, Key>>
impl<M: Model, R, Relation, Key> BoundQuery<'_, SelectRelatedQuery<M, R, Relation, Key>>
Source§impl<'db, M, R, Relation, Key: PrimaryKey> BoundQuery<'db, SelectRelatedQuery<M, R, Relation, Key>>
impl<'db, M, R, Relation, Key: PrimaryKey> BoundQuery<'db, SelectRelatedQuery<M, R, Relation, Key>>
Source§impl<M, R, Relation, Key: PrimaryKey> BoundQuery<'_, SelectRelatedQuery<M, R, Relation, Option<Key>>>
impl<M, R, Relation, Key: PrimaryKey> BoundQuery<'_, SelectRelatedQuery<M, R, Relation, Option<Key>>>
Source§impl<M, R1, Relation1, R2, Relation2, Key1> BoundQuery<'_, MultiSelectRelatedQuery<M, R1, Relation1, R2, Relation2, Key1>>
impl<M, R1, Relation1, R2, Relation2, Key1> BoundQuery<'_, MultiSelectRelatedQuery<M, R1, Relation1, R2, Relation2, Key1>>
Source§impl<'db, M, R, Relation, Key> BoundQuery<'db, PrefetchRelatedQuery<M, R, Relation, Key>>
impl<'db, M, R, Relation, Key> BoundQuery<'db, PrefetchRelatedQuery<M, R, Relation, Key>>
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
pub async fn count(self) -> Result<usize, OrmError>
pub async fn all(
self,
) -> Result<Vec<Loaded<M, (LoadedMany<R, Relation>,)>>, OrmError>where
Relation: Send + 'static,
Source§impl<M, R1, Relation1, R2, Relation2, Key1, Key2> BoundQuery<'_, MultiPrefetchRelatedQuery<M, R1, Relation1, R2, Relation2, Key1, Key2>>where
M: Model + Send + 'static,
R1: Model + Send + 'static,
R2: Model + Send + 'static,
Relation1: Send + 'static,
Relation2: Send + 'static,
Key1: ForeignKeyValue<M::PrimaryKey>,
Key2: ForeignKeyValue<M::PrimaryKey>,
impl<M, R1, Relation1, R2, Relation2, Key1, Key2> BoundQuery<'_, MultiPrefetchRelatedQuery<M, R1, Relation1, R2, Relation2, Key1, Key2>>where
M: Model + Send + 'static,
R1: Model + Send + 'static,
R2: Model + Send + 'static,
Relation1: Send + 'static,
Relation2: Send + 'static,
Key1: ForeignKeyValue<M::PrimaryKey>,
Key2: ForeignKeyValue<M::PrimaryKey>,
pub async fn all( self, ) -> Result<Vec<Loaded<M, (LoadedMany<R1, Relation1>, LoadedMany<R2, Relation2>)>>, OrmError>
Source§impl<M, R, Relation, C, ChildRelation, OuterKey, InnerKey> BoundQuery<'_, NestedPrefetchQuery<M, R, Relation, C, ChildRelation, OuterKey, InnerKey>>where
M: Model + Send + 'static,
R: Model + Send + 'static,
C: Model + Send + 'static,
Relation: Send + 'static,
ChildRelation: Send + 'static,
OuterKey: ForeignKeyValue<M::PrimaryKey>,
InnerKey: ForeignKeyValue<R::PrimaryKey>,
impl<M, R, Relation, C, ChildRelation, OuterKey, InnerKey> BoundQuery<'_, NestedPrefetchQuery<M, R, Relation, C, ChildRelation, OuterKey, InnerKey>>where
M: Model + Send + 'static,
R: Model + Send + 'static,
C: Model + Send + 'static,
Relation: Send + 'static,
ChildRelation: Send + 'static,
OuterKey: ForeignKeyValue<M::PrimaryKey>,
InnerKey: ForeignKeyValue<R::PrimaryKey>,
pub async fn all( self, ) -> Result<Vec<Loaded<M, (LoadedMany<Loaded<R, (LoadedMany<C, ChildRelation>,)>, Relation>,)>>, OrmError>
Auto Trait Implementations§
impl<'db, Q> !RefUnwindSafe for BoundQuery<'db, Q>
impl<'db, Q> !UnwindSafe for BoundQuery<'db, Q>
impl<'db, Q> Forget for BoundQuery<'db, Q>
impl<'db, Q> Freeze for BoundQuery<'db, Q>where
Q: Freeze,
impl<'db, Q> Move for BoundQuery<'db, Q>
impl<'db, Q> Send for BoundQuery<'db, Q>where
Q: Send,
impl<'db, Q> Sync for BoundQuery<'db, Q>where
Q: Sync,
impl<'db, Q> Unpin for BoundQuery<'db, Q>where
Q: Unpin,
impl<'db, Q> UnsafeUnpin for BoundQuery<'db, Q>where
Q: UnsafeUnpin,
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