pub enum ReferentialAction {
NoAction {
meta: Meta,
},
Restrict {
meta: Meta,
},
Cascade {
meta: Meta,
},
SetNull {
columns: ThinVec<Ident>,
meta: Meta,
},
SetDefault {
columns: ThinVec<Ident>,
meta: Meta,
},
}Expand description
A foreign-key <referential action>: what a delete (ON DELETE) or update
(ON UPDATE) of the referenced row does to the referencing rows.
SetNull/SetDefault carry the optional PostgreSQL column list (SET NULL (col, ...)), which restricts the action to a subset of the referencing
columns; the grammar accepts the list only on ON DELETE, so it is always
empty for an ON UPDATE action and for the bare keyword forms. Each variant
carries meta because the action is a span-bearing node — the SET NULL (col)
form references spanned Idents — mirroring IdentityOption.
Variants§
NoAction
NO ACTION — reject the change if references remain (deferrable).
Restrict
RESTRICT — reject the change immediately if references remain.
Cascade
CASCADE — propagate the delete/update to the referencing rows.
SetNull
SET NULL — null out the referencing columns (optionally a subset).
Fields
SetDefault
SET DEFAULT — reset the referencing columns to their defaults.
Trait Implementations§
Source§impl Clone for ReferentialAction
impl Clone for ReferentialAction
Source§fn clone(&self) -> ReferentialAction
fn clone(&self) -> ReferentialAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReferentialAction
impl Debug for ReferentialAction
Source§impl<'de> Deserialize<'de> for ReferentialAction
impl<'de> Deserialize<'de> for ReferentialAction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ReferentialAction
Source§impl Hash for ReferentialAction
impl Hash for ReferentialAction
Source§impl PartialEq for ReferentialAction
impl PartialEq for ReferentialAction
Source§impl Render for ReferentialAction
impl Render for ReferentialAction
Source§fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
Source§fn operand_binding_power(&self) -> Option<BindingPower>
fn operand_binding_power(&self) -> Option<BindingPower>
None (the default) for a self-delimiting node — an atom, call, or
constructor — that never needs parentheses. Read moreSource§impl Serialize for ReferentialAction
impl Serialize for ReferentialAction
Source§impl Spanned for ReferentialAction
impl Spanned for ReferentialAction
impl StructuralPartialEq for ReferentialAction
Auto Trait Implementations§
impl Freeze for ReferentialAction
impl RefUnwindSafe for ReferentialAction
impl Send for ReferentialAction
impl Sync for ReferentialAction
impl Unpin for ReferentialAction
impl UnsafeUnpin for ReferentialAction
impl UnwindSafe for ReferentialAction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DynAstExt for T
impl<T> DynAstExt for T
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&dyn Any for downcasting a node back to its concrete type.Source§fn dyn_clone(&self) -> Box<dyn DynAstExt>
fn dyn_clone(&self) -> Box<dyn DynAstExt>
Clone (whose
Self-returning signature cannot go through a vtable).Source§fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
PartialEq (whose &Self argument cannot go through a vtable). Equal
iff other holds the same concrete type and that type deems the values
equal; differently-typed nodes are never equal.