pub struct ForeignKeyConstraint {
pub name: Option<String>,
pub local_columns: Vec<usize>,
pub parent_table: String,
pub parent_columns: Vec<usize>,
pub on_delete: FkAction,
pub on_update: FkAction,
pub match_type: MatchType,
pub deferrable: bool,
pub initially_deferred: bool,
}Expand description
v7.6.1 — Storage-layer mirror of spg_sql::ast::ForeignKeyConstraint.
The engine’s CREATE TABLE path translates between the two; keeping
them separate preserves the no-deps boundary between
spg-storage and spg-sql.
Fields§
§name: Option<String>Optional user-supplied constraint name (CONSTRAINT <name>
prefix). Used by ALTER TABLE DROP CONSTRAINT <name> in
v7.6.8; ignored by enforcement.
local_columns: Vec<usize>Positions of local columns in this table’s column list.
Same arity as parent_columns.
parent_table: StringReferenced parent table name.
parent_columns: Vec<usize>Positions of parent columns in the parent’s column list. Engine resolves these at CREATE TABLE time (after the parent schema is known) so enforcement paths can skip the name lookup on every row.
on_delete: FkActionReferential action when a parent row is deleted.
on_update: FkActionReferential action when a parent row’s referenced columns are updated.
match_type: MatchTypev7.38 (read01, T29) — MATCH SIMPLE | FULL. Defaults to Simple.
deferrable: boolv7.39 (round 288) — [NOT] DEFERRABLE.
initially_deferred: boolINITIALLY DEFERRED: the check runs at COMMIT rather than at
the statement, unless SET CONSTRAINTS … IMMEDIATE pulls it in.
Trait Implementations§
Source§impl Clone for ForeignKeyConstraint
impl Clone for ForeignKeyConstraint
Source§fn clone(&self) -> ForeignKeyConstraint
fn clone(&self) -> ForeignKeyConstraint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more