pub struct ForeignKey {
pub column: String,
pub ref_table: String,
pub ref_column: String,
pub on_delete: Option<ForeignKeyAction>,
pub on_update: Option<ForeignKeyAction>,
}Expand description
A foreign key: FOREIGN KEY (column) REFERENCES table (column) with
optional ON DELETE / ON UPDATE actions.
PHP: Utopia\Query\Schema\ForeignKey and its dialect classes.
Fields§
§column: StringThe local column.
ref_table: StringThe referenced table.
ref_column: StringThe referenced column.
on_delete: Option<ForeignKeyAction>The action on delete.
on_update: Option<ForeignKeyAction>The action on update.
Implementations§
Source§impl ForeignKey
impl ForeignKey
Sourcepub fn new(column: impl Into<String>) -> Self
pub fn new(column: impl Into<String>) -> Self
A foreign key on column, referencing nothing yet.
PHP: new ForeignKey($table, $column).
Sourcepub fn references(&mut self, column: impl Into<String>) -> &mut Self
pub fn references(&mut self, column: impl Into<String>) -> &mut Self
Sets the referenced column.
PHP: references().
Sourcepub fn on(&mut self, table: impl Into<String>) -> &mut Self
pub fn on(&mut self, table: impl Into<String>) -> &mut Self
Sets the referenced table.
PHP: on().
Sourcepub fn on_delete(&mut self, action: ForeignKeyAction) -> &mut Self
pub fn on_delete(&mut self, action: ForeignKeyAction) -> &mut Self
Sets the action on delete.
PHP: onDelete().
Sourcepub fn on_update(&mut self, action: ForeignKeyAction) -> &mut Self
pub fn on_update(&mut self, action: ForeignKeyAction) -> &mut Self
Sets the action on update.
PHP: onUpdate().
Trait Implementations§
Source§impl Clone for ForeignKey
impl Clone for ForeignKey
Source§impl Debug for ForeignKey
impl Debug for ForeignKey
impl Eq for ForeignKey
Source§impl PartialEq for ForeignKey
impl PartialEq for ForeignKey
impl StructuralPartialEq for ForeignKey
Auto Trait Implementations§
impl Forget for ForeignKey
impl Freeze for ForeignKey
impl Move for ForeignKey
impl RefUnwindSafe for ForeignKey
impl Send for ForeignKeywhere
RawVecInner: Send,
impl Sync for ForeignKeywhere
RawVecInner: Sync,
impl Unpin for ForeignKey
impl UnsafeUnpin for ForeignKey
impl UnwindSafe for ForeignKeywhere
RawVecInner: 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.