pub struct PolymorphicJoinedSelect<Base: Model, Child: Model> { /* private fields */ }Expand description
A polymorphic SELECT for joined-table inheritance base + single child.
Construct via select!(Base).polymorphic_joined::<Child>().
Implementations§
Source§impl<Base: Model, Child: Model> PolymorphicJoinedSelect<Base, Child>
impl<Base: Model, Child: Model> PolymorphicJoinedSelect<Base, Child>
Sourcepub fn filter(self, expr: Expr) -> Self
pub fn filter(self, expr: Expr) -> Self
Add a WHERE condition (delegates to the underlying base select).
Sourcepub fn order_by(self, order: OrderBy) -> Self
pub fn order_by(self, order: OrderBy) -> Self
Add ORDER BY clause (delegates to the underlying base select).
Sourcepub fn build_with_dialect(&self, dialect: Dialect) -> (String, Vec<Value>)
pub fn build_with_dialect(&self, dialect: Dialect) -> (String, Vec<Value>)
Build the SQL query and parameters.
Sourcepub async fn all<C: Connection>(
self,
cx: &Cx,
conn: &C,
) -> Outcome<Vec<PolymorphicJoined<Base, Child>>, Error>
pub async fn all<C: Connection>( self, cx: &Cx, conn: &C, ) -> Outcome<Vec<PolymorphicJoined<Base, Child>>, Error>
Execute the polymorphic query and hydrate either Base or Child per row.
Trait Implementations§
Source§impl<Base: Clone + Model, Child: Clone + Model> Clone for PolymorphicJoinedSelect<Base, Child>
impl<Base: Clone + Model, Child: Clone + Model> Clone for PolymorphicJoinedSelect<Base, Child>
Source§fn clone(&self) -> PolymorphicJoinedSelect<Base, Child>
fn clone(&self) -> PolymorphicJoinedSelect<Base, Child>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<Base, Child> Freeze for PolymorphicJoinedSelect<Base, Child>
impl<Base, Child> RefUnwindSafe for PolymorphicJoinedSelect<Base, Child>where
Child: RefUnwindSafe,
Base: RefUnwindSafe,
impl<Base, Child> Send for PolymorphicJoinedSelect<Base, Child>
impl<Base, Child> Sync for PolymorphicJoinedSelect<Base, Child>
impl<Base, Child> Unpin for PolymorphicJoinedSelect<Base, Child>
impl<Base, Child> UnwindSafe for PolymorphicJoinedSelect<Base, Child>where
Child: UnwindSafe,
Base: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).