pub struct JoinedManyQuery<T, U, E: EntityTrait, F: EntityTrait> { /* private fields */ }Expand description
A query builder wrapping SeaORM’s SelectTwoMany<E, F> for 1:N joins.
Results are auto-converted to (T, Vec<U>) tuples via From<Model>.
Implementations§
Source§impl<T, U, E, F> JoinedManyQuery<T, U, E, F>where
E: EntityTrait,
F: EntityTrait,
T: From<E::Model> + Send + Sync,
U: From<F::Model> + Send + Sync,
E::Model: FromQueryResult + Send + Sync,
F::Model: FromQueryResult + Send + Sync,
impl<T, U, E, F> JoinedManyQuery<T, U, E, F>where
E: EntityTrait,
F: EntityTrait,
T: From<E::Model> + Send + Sync,
U: From<F::Model> + Send + Sync,
E::Model: FromQueryResult + Send + Sync,
F::Model: FromQueryResult + Send + Sync,
Sourcepub fn filter(self, f: impl IntoCondition) -> Self
pub fn filter(self, f: impl IntoCondition) -> Self
Apply a WHERE condition.
Sourcepub fn order_by_asc<C: ColumnTrait>(self, col: C) -> Self
pub fn order_by_asc<C: ColumnTrait>(self, col: C) -> Self
ORDER BY col ASC.
Sourcepub fn order_by_desc<C: ColumnTrait>(self, col: C) -> Self
pub fn order_by_desc<C: ColumnTrait>(self, col: C) -> Self
ORDER BY col DESC.
Sourcepub async fn all(
self,
db: &impl ConnectionTrait,
) -> Result<Vec<(T, Vec<U>)>, Error>
pub async fn all( self, db: &impl ConnectionTrait, ) -> Result<Vec<(T, Vec<U>)>, Error>
Fetch all matching rows, converting both models to domain types.
Sourcepub fn into_select(self) -> SelectTwoMany<E, F>
pub fn into_select(self) -> SelectTwoMany<E, F>
Unwrap the inner SelectTwoMany<E, F> for advanced SeaORM usage.
Auto Trait Implementations§
impl<T, U, E, F> Freeze for JoinedManyQuery<T, U, E, F>
impl<T, U, E, F> RefUnwindSafe for JoinedManyQuery<T, U, E, F>
impl<T, U, E, F> Send for JoinedManyQuery<T, U, E, F>
impl<T, U, E, F> Sync for JoinedManyQuery<T, U, E, F>
impl<T, U, E, F> Unpin for JoinedManyQuery<T, U, E, F>
impl<T, U, E, F> UnsafeUnpin for JoinedManyQuery<T, U, E, F>
impl<T, U, E, F> UnwindSafe for JoinedManyQuery<T, U, E, F>
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> DefaultHooks for T
impl<T> DefaultHooks for 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>
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