pub struct ScopedQueryBuilder<E>{ /* private fields */ }Expand description
Query builder with scopes applied
Implementations§
Source§impl<E> ScopedQueryBuilder<E>
impl<E> ScopedQueryBuilder<E>
Sourcepub fn filter<F>(self, filter: F) -> Selfwhere
F: IntoCondition,
pub fn filter<F>(self, filter: F) -> Selfwhere
F: IntoCondition,
Add a filter condition
Sourcepub fn into_query(self) -> QueryBuilder<E>
pub fn into_query(self) -> QueryBuilder<E>
Get the underlying query builder
Sourcepub async fn all(self) -> Result<Vec<E::Model>, FrameworkError>
pub async fn all(self) -> Result<Vec<E::Model>, FrameworkError>
Execute query and return all results
Sourcepub async fn first(self) -> Result<Option<E::Model>, FrameworkError>
pub async fn first(self) -> Result<Option<E::Model>, FrameworkError>
Execute query and return first result
Sourcepub async fn first_or_fail(self) -> Result<E::Model, FrameworkError>
pub async fn first_or_fail(self) -> Result<E::Model, FrameworkError>
Execute query and return first result or error
Sourcepub async fn count(self) -> Result<u64, FrameworkError>
pub async fn count(self) -> Result<u64, FrameworkError>
Count matching records
Sourcepub async fn exists(self) -> Result<bool, FrameworkError>
pub async fn exists(self) -> Result<bool, FrameworkError>
Check if any records exist
Auto Trait Implementations§
impl<E> Freeze for ScopedQueryBuilder<E>
impl<E> !RefUnwindSafe for ScopedQueryBuilder<E>
impl<E> Send for ScopedQueryBuilder<E>
impl<E> Sync for ScopedQueryBuilder<E>
impl<E> Unpin for ScopedQueryBuilder<E>where
E: Unpin,
impl<E> UnsafeUnpin for ScopedQueryBuilder<E>
impl<E> !UnwindSafe for ScopedQueryBuilder<E>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more