Skip to main content

Foreign

Struct Foreign 

Source
pub struct Foreign {
Show 16 fields pub name: String, pub referencing: bool, pub action: Action, pub query: String, pub full: bool, pub other: u32, pub other_name: String, pub columns: Vec<usize>, pub names: Vec<String>, pub other_columns: Vec<usize>, pub types: Vec<u32>, pub referencing_types: Vec<u32>, pub constraint: u32, pub deferrable: bool, pub deferred: bool, pub cloned: bool,
}
Expand description

A foreign key that a write checks after the statement for each row that it wrote, as a trigger of ri_triggers.c checks it. The target table is the referencing table for RI_FKey_check_ins and RI_FKey_check_upd, and the referenced table for the triggers of the actions, such as RI_FKey_noaction_del and RI_FKey_cascade_upd.

Fields§

§name: String

The name of the constraint.

§referencing: bool

True when the target table is the referencing table.

§action: Action

The action for an old key of the referenced table. It is Action::NoAction for the referencing table.

§query: String

The statement of CASCADE, SET NULL or SET DEFAULT on the referencing table, as ri_PlanCheck makes it, or an empty text. Its parameters are the old key, or for ON UPDATE CASCADE the new key and then the old key, with the types of Foreign::types.

§full: bool

MATCH FULL: a key with nulls and values is an error.

§other: u32

The OID of the other table.

§other_name: String

The name of the other table, for the error.

§columns: Vec<usize>

The key columns of the target table, from 0.

§names: Vec<String>

The names of the key columns of the target table, for the detail of the error.

§other_columns: Vec<usize>

The key columns of the other table, from 0.

§types: Vec<u32>

The type of each column of the key of the referenced table. The checks compare the values of the referencing table as values of these types.

§referencing_types: Vec<u32>

The type of each column of the key of the referencing table.

§constraint: u32

The OID of the constraint, which SET CONSTRAINTS names.

§deferrable: bool

tgdeferrable: SET CONSTRAINTS can defer the trigger. The trigger of an action is not deferrable.

§deferred: bool

tginitdeferred: the trigger fires at the commit when SET CONSTRAINTS does not change its mode.

§cloned: bool

tgisclone: the trigger is a clone of a trigger of the parent table. The delete of a row that an UPDATE moves to another partition skips such a trigger of the referenced table, because the event of the update of the partitioned table does its work.

Trait Implementations§

Source§

impl Clone for Foreign

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Foreign

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Foreign

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Foreign

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.