pub struct QueryData<E>where
E: EntityTrait,
E::ModelEx: BaseEntity,
<E::ModelEx as BaseEntity>::LoaderType: EntityLoaderTrait<E, ModelEx = E::ModelEx>,{
pub loader: <E::ModelEx as BaseEntity>::LoaderType,
pub opts: RepositoryOptions<NoUser>,
pub order_asc: Option<bool>,
}Expand description
Builder wrapping a SeaORM entity loader with pagination and hydration settings.
E is the SeaORM entity being queried; its model must implement BaseEntity
so cursor pagination can use id comparisons. order_asc records the
cursor direction (Some(true) ascending, Some(false) descending).
Fields§
§loader: <E::ModelEx as BaseEntity>::LoaderTypeThe entity loader used to load relations for this entity type.
opts: RepositoryOptions<NoUser>Limit/cursor/distinct/detach settings applied at execution time.
order_asc: Option<bool>Recorded ordering direction for cursor filtering, if any ordering was set.
Implementations§
Source§impl<E> QueryData<E>where
E: EntityTrait,
E::ModelEx: BaseEntity,
<E::ModelEx as BaseEntity>::LoaderType: EntityLoaderTrait<E, ModelEx = E::ModelEx>,
impl<E> QueryData<E>where
E: EntityTrait,
E::ModelEx: BaseEntity,
<E::ModelEx as BaseEntity>::LoaderType: EntityLoaderTrait<E, ModelEx = E::ModelEx>,
Sourcepub fn new(loader: <E::ModelEx as BaseEntity>::LoaderType) -> Self
pub fn new(loader: <E::ModelEx as BaseEntity>::LoaderType) -> Self
Wraps an entity loader with default options and no ordering.
Sourcepub fn with_options<U>(self, opts: RepositoryOptions<U>) -> Self
pub fn with_options<U>(self, opts: RepositoryOptions<U>) -> Self
Copies limit, cursor, distinct, detach, correlation, and transaction settings from the given options.
Sourcepub fn order_by(self, asc: bool) -> Self
pub fn order_by(self, asc: bool) -> Self
Orders by id and records the direction for cursor filtering.
Sourcepub fn order_by_asc(self) -> Self
pub fn order_by_asc(self) -> Self
Orders by ascending id and records ascending cursor direction.
Sourcepub fn order_by_desc(self) -> Self
pub fn order_by_desc(self) -> Self
Orders by descending id and records descending cursor direction.
Sourcepub fn distinct(self) -> Self
pub fn distinct(self) -> Self
Marks the select distinct and records the distinct flag in options.
Sourcepub fn with_limit(self, limit: u64) -> Self
pub fn with_limit(self, limit: u64) -> Self
Sets the select limit and records it in options.
Auto Trait Implementations§
impl<E> !RefUnwindSafe for QueryData<E>
impl<E> !UnwindSafe for QueryData<E>
impl<E> Freeze for QueryData<E>
impl<E> Send for QueryData<E>
impl<E> Sync for QueryData<E>
impl<E> Unpin for QueryData<E>
impl<E> UnsafeUnpin for QueryData<E>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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> ⓘ
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> ⓘ
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