pub struct ForeignKeyBuilder<'a> { /* private fields */ }Expand description
Fluent builder returned by Table::foreign(col). Drop it (or call .constrain())
to commit the foreign key SQL.
Implementations§
Source§impl<'a> ForeignKeyBuilder<'a>
impl<'a> ForeignKeyBuilder<'a>
Sourcepub fn references(self, column: &str) -> ForeignKeyBuilder<'a>
pub fn references(self, column: &str) -> ForeignKeyBuilder<'a>
The referenced column on the foreign table. Default: "id".
Sourcepub fn on(self, table: &str) -> ForeignKeyBuilder<'a>
pub fn on(self, table: &str) -> ForeignKeyBuilder<'a>
The foreign table.
Sourcepub fn on_delete(self, action: &str) -> ForeignKeyBuilder<'a>
pub fn on_delete(self, action: &str) -> ForeignKeyBuilder<'a>
ON DELETE CASCADE (or RESTRICT / SET NULL / SET DEFAULT).
pub fn on_update(self, action: &str) -> ForeignKeyBuilder<'a>
pub fn cascade(self) -> ForeignKeyBuilder<'a>
pub fn set_null(self) -> ForeignKeyBuilder<'a>
pub fn restrict(self) -> ForeignKeyBuilder<'a>
Trait Implementations§
Source§impl<'a> Drop for ForeignKeyBuilder<'a>
impl<'a> Drop for ForeignKeyBuilder<'a>
Auto Trait Implementations§
impl<'a> Freeze for ForeignKeyBuilder<'a>
impl<'a> RefUnwindSafe for ForeignKeyBuilder<'a>
impl<'a> Send for ForeignKeyBuilder<'a>
impl<'a> Sync for ForeignKeyBuilder<'a>
impl<'a> Unpin for ForeignKeyBuilder<'a>
impl<'a> UnsafeUnpin for ForeignKeyBuilder<'a>
impl<'a> !UnwindSafe for ForeignKeyBuilder<'a>
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> 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