Struct photon_indexer::migration::sea_orm::RelationBuilder
source · pub struct RelationBuilder<E, R>where
E: EntityTrait,
R: EntityTrait,{ /* private fields */ }Expand description
Defines a helper to build a relation
Implementations§
source§impl<E, R> RelationBuilder<E, R>where
E: EntityTrait,
R: EntityTrait,
impl<E, R> RelationBuilder<E, R>where
E: EntityTrait,
R: EntityTrait,
sourcepub fn from<T>(self, identifier: T) -> RelationBuilder<E, R>where
T: IdentityOf<E>,
pub fn from<T>(self, identifier: T) -> RelationBuilder<E, R>where
T: IdentityOf<E>,
Build a relationship from an Entity
sourcepub fn to<T>(self, identifier: T) -> RelationBuilder<E, R>where
T: IdentityOf<R>,
pub fn to<T>(self, identifier: T) -> RelationBuilder<E, R>where
T: IdentityOf<R>,
Build a relationship to an Entity
sourcepub fn on_delete(self, action: ForeignKeyAction) -> RelationBuilder<E, R>
pub fn on_delete(self, action: ForeignKeyAction) -> RelationBuilder<E, R>
An operation to perform on a foreign key when a delete operation occurs
sourcepub fn on_update(self, action: ForeignKeyAction) -> RelationBuilder<E, R>
pub fn on_update(self, action: ForeignKeyAction) -> RelationBuilder<E, R>
An operation to perform on a foreign key when an update operation occurs
sourcepub fn on_condition<F>(self, f: F) -> RelationBuilder<E, R>
pub fn on_condition<F>(self, f: F) -> RelationBuilder<E, R>
Set custom join ON condition.
This method takes a closure with parameters denoting the left-hand side and right-hand side table in the join expression.
sourcepub fn fk_name(self, fk_name: &str) -> RelationBuilder<E, R>
pub fn fk_name(self, fk_name: &str) -> RelationBuilder<E, R>
Set the name of foreign key constraint
Trait Implementations§
source§impl<E, R> Debug for RelationBuilder<E, R>where
E: EntityTrait,
R: EntityTrait,
impl<E, R> Debug for RelationBuilder<E, R>where
E: EntityTrait,
R: EntityTrait,
source§impl<E, R> From<RelationBuilder<E, R>> for RelationDefwhere
E: EntityTrait,
R: EntityTrait,
impl<E, R> From<RelationBuilder<E, R>> for RelationDefwhere
E: EntityTrait,
R: EntityTrait,
source§fn from(b: RelationBuilder<E, R>) -> RelationDef
fn from(b: RelationBuilder<E, R>) -> RelationDef
Converts to this type from the input type.
Auto Trait Implementations§
impl<E, R> Freeze for RelationBuilder<E, R>
impl<E, R> !RefUnwindSafe for RelationBuilder<E, R>
impl<E, R> Send for RelationBuilder<E, R>
impl<E, R> Sync for RelationBuilder<E, R>
impl<E, R> Unpin for RelationBuilder<E, R>
impl<E, R> !UnwindSafe for RelationBuilder<E, R>
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
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