Struct leetcode_tui_rs::migrations::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>where
F: Fn(Arc<dyn Iden, Global>, Arc<dyn Iden, Global>) -> Condition + 'static + Send + Sync,
pub fn on_condition<F>(self, f: F) -> RelationBuilder<E, R>where F: Fn(Arc<dyn Iden, Global>, Arc<dyn Iden, Global>) -> Condition + 'static + Send + Sync,
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> !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>where E: Unpin, R: Unpin,
impl<E, R> !UnwindSafe for RelationBuilder<E, R>
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