Skip to main content

TriggerInfo

Struct TriggerInfo 

Source
pub struct TriggerInfo {
    pub name: Vec<u8>,
    pub folded: Vec<u8>,
    pub time: TriggerTime,
    pub event: TriggerEventInfo,
    pub ast: Ast,
    pub when: Option<ExprId>,
    pub body: Vec<Statement>,
    pub table_database: Option<Vec<u8>>,
}
Expand description

A trigger’s parsed definition.

Kept parsed here for the same reason a view body is: the arena belongs to the catalog snapshot, which the binder holds for the whole statement, so a body can be bound in place. A body re-parsed inside the binder would be a local whose borrow ends before the bound tree does.

Fields§

§name: Vec<u8>

The trigger name as declared.

§folded: Vec<u8>

The ASCII-folded lookup key.

§time: TriggerTime

When it fires. CREATE TRIGGER with no time written means BEFORE.

§event: TriggerEventInfo

What it fires on.

§ast: Ast

The arena the WHEN guard and the body were parsed into.

§when: Option<ExprId>

The WHEN guard, when one was written.

§body: Vec<Statement>

The body statements, in written order.

§table_database: Option<Vec<u8>>

The folded database the ON clause named, as in ON main.t, when it named one.

Implementations§

Source§

impl TriggerInfo

Source

pub fn fires_for(&self, event: &TriggerEventInfo, changed: &[Vec<u8>]) -> bool

Returns whether this trigger fires for one event on one column set.

changed is the folded names an UPDATE assigns, and is empty for the other two events. UPDATE OF a, b fires only when the statement writes a or b - which SQLite decides from the statement, not from whether the value actually differs.

Trait Implementations§

Source§

impl Clone for TriggerInfo

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 TriggerInfo

Source§

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

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

impl Eq for TriggerInfo

Source§

impl PartialEq for TriggerInfo

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 TriggerInfo

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.