pub struct TriggerBuilder { /* private fields */ }Expand description
Builder for creating triggers.
Implementations§
Source§impl TriggerBuilder
impl TriggerBuilder
Sourcepub fn timing(self, timing: TriggerTiming) -> Self
pub fn timing(self, timing: TriggerTiming) -> Self
Set the trigger timing.
Sourcepub fn instead_of(self) -> Self
pub fn instead_of(self) -> Self
Set timing to INSTEAD OF.
Sourcepub fn event(self, event: TriggerEvent) -> Self
pub fn event(self, event: TriggerEvent) -> Self
Add a triggering event.
Sourcepub fn events(self, events: impl IntoIterator<Item = TriggerEvent>) -> Self
pub fn events(self, events: impl IntoIterator<Item = TriggerEvent>) -> Self
Add multiple triggering events.
Sourcepub fn on_truncate(self) -> Self
pub fn on_truncate(self) -> Self
Trigger on TRUNCATE (PostgreSQL only).
Sourcepub fn level(self, level: TriggerLevel) -> Self
pub fn level(self, level: TriggerLevel) -> Self
Set the trigger level.
Sourcepub fn for_each_row(self) -> Self
pub fn for_each_row(self) -> Self
Set to row-level trigger.
Sourcepub fn for_each_statement(self) -> Self
pub fn for_each_statement(self) -> Self
Set to statement-level trigger.
Sourcepub fn update_of(
self,
columns: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn update_of( self, columns: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Specify columns for UPDATE OF.
Sourcepub fn when(self, condition: TriggerCondition) -> Self
pub fn when(self, condition: TriggerCondition) -> Self
Add a WHEN condition.
Sourcepub fn when_expr(self, expression: impl Into<String>) -> Self
pub fn when_expr(self, expression: impl Into<String>) -> Self
Add a WHEN condition from a raw expression.
Sourcepub fn execute_function(self, name: impl Into<String>) -> Self
pub fn execute_function(self, name: impl Into<String>) -> Self
Set the action to execute a function.
Sourcepub fn execute_function_with_args(
self,
name: impl Into<String>,
args: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn execute_function_with_args( self, name: impl Into<String>, args: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Set the action to execute a function with arguments.
Sourcepub fn execute_sql(
self,
statements: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn execute_sql( self, statements: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Set the action to inline SQL.
Sourcepub fn build(self) -> QueryResult<Trigger>
pub fn build(self) -> QueryResult<Trigger>
Build the trigger.
Trait Implementations§
Source§impl Clone for TriggerBuilder
impl Clone for TriggerBuilder
Source§fn clone(&self) -> TriggerBuilder
fn clone(&self) -> TriggerBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TriggerBuilder
impl RefUnwindSafe for TriggerBuilder
impl Send for TriggerBuilder
impl Sync for TriggerBuilder
impl Unpin for TriggerBuilder
impl UnwindSafe for TriggerBuilder
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