pub struct ForeignKeyCreateStatement { /* private fields */ }Expand description
Builder for a CREATE FOREIGN KEY constraint.
This builder collects foreign key metadata (source table/columns, referenced table/columns, and referential actions) for use in CREATE TABLE statements.
Implementations§
Source§impl ForeignKeyCreateStatement
impl ForeignKeyCreateStatement
Sourcepub fn from_tbl<T>(&mut self, tbl: T) -> &mut Selfwhere
T: IntoTableRef,
pub fn from_tbl<T>(&mut self, tbl: T) -> &mut Selfwhere
T: IntoTableRef,
Set the source (referencing) table.
Sourcepub fn from_col<C>(&mut self, col: C) -> &mut Selfwhere
C: IntoIden,
pub fn from_col<C>(&mut self, col: C) -> &mut Selfwhere
C: IntoIden,
Add a source (referencing) column.
Sourcepub fn to_tbl<T>(&mut self, tbl: T) -> &mut Selfwhere
T: IntoTableRef,
pub fn to_tbl<T>(&mut self, tbl: T) -> &mut Selfwhere
T: IntoTableRef,
Set the target (referenced) table.
Sourcepub fn to_col<C>(&mut self, col: C) -> &mut Selfwhere
C: IntoIden,
pub fn to_col<C>(&mut self, col: C) -> &mut Selfwhere
C: IntoIden,
Add a target (referenced) column.
Sourcepub fn on_delete(&mut self, action: ForeignKeyAction) -> &mut Self
pub fn on_delete(&mut self, action: ForeignKeyAction) -> &mut Self
Set the ON DELETE action.
Sourcepub fn on_update(&mut self, action: ForeignKeyAction) -> &mut Self
pub fn on_update(&mut self, action: ForeignKeyAction) -> &mut Self
Set the ON UPDATE action.
Trait Implementations§
Source§impl Clone for ForeignKeyCreateStatement
impl Clone for ForeignKeyCreateStatement
Source§fn clone(&self) -> ForeignKeyCreateStatement
fn clone(&self) -> ForeignKeyCreateStatement
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 moreSource§impl Debug for ForeignKeyCreateStatement
impl Debug for ForeignKeyCreateStatement
Source§impl Default for ForeignKeyCreateStatement
impl Default for ForeignKeyCreateStatement
Source§fn default() -> ForeignKeyCreateStatement
fn default() -> ForeignKeyCreateStatement
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ForeignKeyCreateStatement
impl !RefUnwindSafe for ForeignKeyCreateStatement
impl !Send for ForeignKeyCreateStatement
impl !Sync for ForeignKeyCreateStatement
impl Unpin for ForeignKeyCreateStatement
impl UnsafeUnpin for ForeignKeyCreateStatement
impl !UnwindSafe for ForeignKeyCreateStatement
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