pub struct TriggerBuilder { /* private fields */ }Expand description
Builder for constructing database triggers
Implementations§
Source§impl TriggerBuilder
impl TriggerBuilder
Sourcepub fn set_name(&mut self, name: impl Into<String>)
pub fn set_name(&mut self, name: impl Into<String>)
Set the trigger name (mutable reference version for conditional building)
Sourcepub fn set_schema(&mut self, schema: impl Into<String>)
pub fn set_schema(&mut self, schema: impl Into<String>)
Set the schema name (mutable reference version for conditional building)
Sourcepub fn set_table_name(&mut self, table_name: impl Into<String>)
pub fn set_table_name(&mut self, table_name: impl Into<String>)
Set the table name (mutable reference version for conditional building)
Sourcepub fn on_table_in_schema(self, table_schema: impl Into<String>) -> Self
pub fn on_table_in_schema(self, table_schema: impl Into<String>) -> Self
Set the table schema
Sourcepub fn set_table_schema(&mut self, table_schema: impl Into<String>)
pub fn set_table_schema(&mut self, table_schema: impl Into<String>)
Set the table schema (mutable reference version for conditional building)
Sourcepub fn timing(self, timing: TriggerTiming) -> Self
pub fn timing(self, timing: TriggerTiming) -> Self
Set the trigger timing
Sourcepub fn set_timing(&mut self, timing: TriggerTiming)
pub fn set_timing(&mut self, timing: TriggerTiming)
Set the trigger timing (mutable reference version for conditional building)
Sourcepub fn event(self, event: TriggerEvent) -> Self
pub fn event(self, event: TriggerEvent) -> Self
Add a trigger event
Sourcepub fn add_event(&mut self, event: TriggerEvent)
pub fn add_event(&mut self, event: TriggerEvent)
Add a trigger event (mutable reference version for conditional building)
Sourcepub fn events(self, events: impl IntoIterator<Item = TriggerEvent>) -> Self
pub fn events(self, events: impl IntoIterator<Item = TriggerEvent>) -> Self
Add multiple trigger events
Sourcepub fn add_events(&mut self, events: impl IntoIterator<Item = TriggerEvent>)
pub fn add_events(&mut self, events: impl IntoIterator<Item = TriggerEvent>)
Add multiple trigger events (mutable reference version for conditional building)
Sourcepub fn orientation(self, orientation: TriggerOrientation) -> Self
pub fn orientation(self, orientation: TriggerOrientation) -> Self
Set the trigger orientation
Sourcepub fn set_orientation(&mut self, orientation: TriggerOrientation)
pub fn set_orientation(&mut self, orientation: TriggerOrientation)
Set the trigger orientation (mutable reference version for conditional building)
Sourcepub fn set_function(&mut self, function_name: impl Into<String>)
pub fn set_function(&mut self, function_name: impl Into<String>)
Set the function name (mutable reference version for conditional building)
Sourcepub fn function_in_schema(self, function_schema: impl Into<String>) -> Self
pub fn function_in_schema(self, function_schema: impl Into<String>) -> Self
Set the function schema
Sourcepub fn set_function_schema(&mut self, function_schema: impl Into<String>)
pub fn set_function_schema(&mut self, function_schema: impl Into<String>)
Set the function schema (mutable reference version for conditional building)
Sourcepub fn set_condition(&mut self, condition: impl Into<String>)
pub fn set_condition(&mut self, condition: impl Into<String>)
Set the trigger condition (mutable reference version for conditional building)
Sourcepub fn update_columns(
self,
columns: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn update_columns( self, columns: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Set specific columns for UPDATE triggers
Sourcepub fn set_update_columns(
&mut self,
columns: impl IntoIterator<Item = impl Into<String>>,
)
pub fn set_update_columns( &mut self, columns: impl IntoIterator<Item = impl Into<String>>, )
Set specific columns for UPDATE triggers (mutable reference version for conditional building)
Sourcepub fn referencing(
self,
old_table: Option<String>,
new_table: Option<String>,
) -> Self
pub fn referencing( self, old_table: Option<String>, new_table: Option<String>, ) -> Self
Set transition table references
Sourcepub fn set_referencing(
&mut self,
old_table: Option<String>,
new_table: Option<String>,
)
pub fn set_referencing( &mut self, old_table: Option<String>, new_table: Option<String>, )
Set transition table references (mutable reference version for conditional building)
Sourcepub fn set_comment(&mut self, comment: impl Into<String>)
pub fn set_comment(&mut self, comment: impl Into<String>)
Set a comment on the trigger (mutable reference version for conditional building)
Sourcepub fn instead_of() -> Self
pub fn instead_of() -> Self
Create an INSTEAD OF trigger
Sourcepub fn on_truncate() -> Self
pub fn on_truncate() -> Self
Create a TRUNCATE trigger
Sourcepub fn validation() -> Self
pub fn validation() -> Self
Create a validation trigger
Sourcepub fn get_schema(&self) -> Option<&str>
pub fn get_schema(&self) -> Option<&str>
Get the schema name
Sourcepub fn get_table_name(&self) -> Option<&str>
pub fn get_table_name(&self) -> Option<&str>
Get the table name
Sourcepub fn get_table_schema(&self) -> Option<&str>
pub fn get_table_schema(&self) -> Option<&str>
Get the table schema
Sourcepub fn get_timing(&self) -> Option<&TriggerTiming>
pub fn get_timing(&self) -> Option<&TriggerTiming>
Get the trigger timing
Sourcepub fn get_events(&self) -> &[TriggerEvent]
pub fn get_events(&self) -> &[TriggerEvent]
Get the trigger events
Sourcepub fn get_orientation(&self) -> Option<&TriggerOrientation>
pub fn get_orientation(&self) -> Option<&TriggerOrientation>
Get the trigger orientation
Sourcepub fn get_function_name(&self) -> Option<&str>
pub fn get_function_name(&self) -> Option<&str>
Get the function name
Sourcepub fn get_function_schema(&self) -> Option<&str>
pub fn get_function_schema(&self) -> Option<&str>
Get the function schema
Sourcepub fn get_condition(&self) -> Option<&str>
pub fn get_condition(&self) -> Option<&str>
Get the trigger condition
Sourcepub fn get_update_columns(&self) -> Option<&[String]>
pub fn get_update_columns(&self) -> Option<&[String]>
Get the update columns
Sourcepub fn get_referencing(&self) -> Option<&TriggerReferencing>
pub fn get_referencing(&self) -> Option<&TriggerReferencing>
Get the referencing clause
Sourcepub fn get_comment(&self) -> Option<&str>
pub fn get_comment(&self) -> Option<&str>
Get the comment
Sourcepub fn event_count(&self) -> usize
pub fn event_count(&self) -> usize
Get the number of events
Sourcepub fn has_event(&self, event: &TriggerEvent) -> bool
pub fn has_event(&self, event: &TriggerEvent) -> bool
Check if the trigger has a specific event
Sourcepub fn has_schema(&self) -> bool
pub fn has_schema(&self) -> bool
Check if the trigger has a schema
Sourcepub fn has_table_name(&self) -> bool
pub fn has_table_name(&self) -> bool
Check if the trigger has a table name
Sourcepub fn has_table_schema(&self) -> bool
pub fn has_table_schema(&self) -> bool
Check if the trigger has a table schema
Sourcepub fn has_timing(&self) -> bool
pub fn has_timing(&self) -> bool
Check if the trigger has timing
Sourcepub fn has_events(&self) -> bool
pub fn has_events(&self) -> bool
Check if the trigger has events
Sourcepub fn has_orientation(&self) -> bool
pub fn has_orientation(&self) -> bool
Check if the trigger has orientation
Sourcepub fn has_function_name(&self) -> bool
pub fn has_function_name(&self) -> bool
Check if the trigger has a function name
Sourcepub fn has_function_schema(&self) -> bool
pub fn has_function_schema(&self) -> bool
Check if the trigger has a function schema
Sourcepub fn has_condition(&self) -> bool
pub fn has_condition(&self) -> bool
Check if the trigger has a condition
Sourcepub fn has_update_columns(&self) -> bool
pub fn has_update_columns(&self) -> bool
Check if the trigger has update columns
Sourcepub fn has_referencing(&self) -> bool
pub fn has_referencing(&self) -> bool
Check if the trigger has referencing
Sourcepub fn has_comment(&self) -> bool
pub fn has_comment(&self) -> bool
Check if the trigger has a comment
Trait Implementations§
Source§impl Clone for TriggerBuilder
impl Clone for TriggerBuilder
Source§fn clone(&self) -> TriggerBuilder
fn clone(&self) -> TriggerBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ConditionalBuilder for TriggerBuilder
impl ConditionalBuilder for TriggerBuilder
Source§impl Debug for TriggerBuilder
impl Debug for TriggerBuilder
Source§impl InspectableBuilder for TriggerBuilder
impl InspectableBuilder for TriggerBuilder
Source§impl SchemaBuilder for TriggerBuilder
impl SchemaBuilder for TriggerBuilder
Source§impl ValidatableBuilder for TriggerBuilder
impl ValidatableBuilder for TriggerBuilder
Auto Trait Implementations§
impl Freeze for TriggerBuilder
impl RefUnwindSafe for TriggerBuilder
impl Send for TriggerBuilder
impl Sync for TriggerBuilder
impl Unpin for TriggerBuilder
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more