pub struct FunctionBuilder { /* private fields */ }Expand description
Builder for constructing database functions
Implementations§
Source§impl FunctionBuilder
impl FunctionBuilder
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Set the function name (can be schema-qualified like “auth.my_function”)
Sourcepub fn set_name(&mut self, name: impl Into<String>)
pub fn set_name(&mut self, name: impl Into<String>)
Set the function name (mutable reference version for conditional building) Can be schema-qualified like “auth.my_function”
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 parameter(
self,
name: impl Into<String>,
param_type: impl Into<String>,
) -> Self
pub fn parameter( self, name: impl Into<String>, param_type: impl Into<String>, ) -> Self
Add a parameter to the function
Sourcepub fn add_parameter(
&mut self,
name: impl Into<String>,
param_type: impl Into<String>,
)
pub fn add_parameter( &mut self, name: impl Into<String>, param_type: impl Into<String>, )
Add a parameter to the function (mutable reference version for conditional building)
Sourcepub fn parameters(
self,
params: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>,
) -> Self
pub fn parameters( self, params: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>, ) -> Self
Add multiple parameters to the function
Sourcepub fn add_parameters(
&mut self,
params: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>,
)
pub fn add_parameters( &mut self, params: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>, )
Add multiple parameters to the function (mutable reference version for conditional building)
Sourcepub fn set_return_type(&mut self, return_type: impl Into<String>)
pub fn set_return_type(&mut self, return_type: impl Into<String>)
Set the return type (mutable reference version for conditional building)
Sourcepub fn language(self, language: ProcedureLanguage) -> Self
pub fn language(self, language: ProcedureLanguage) -> Self
Set the function language
Sourcepub fn set_language(&mut self, language: ProcedureLanguage)
pub fn set_language(&mut self, language: ProcedureLanguage)
Set the function language (mutable reference version for conditional building)
Sourcepub fn volatility(self, volatility: FunctionVolatility) -> Self
pub fn volatility(self, volatility: FunctionVolatility) -> Self
Set the function volatility
Sourcepub fn set_volatility(&mut self, volatility: FunctionVolatility)
pub fn set_volatility(&mut self, volatility: FunctionVolatility)
Set the function volatility (mutable reference version for conditional building)
Sourcepub fn security(self, security: FunctionSecurity) -> Self
pub fn security(self, security: FunctionSecurity) -> Self
Set the function security
Sourcepub fn set_security(&mut self, security: FunctionSecurity)
pub fn set_security(&mut self, security: FunctionSecurity)
Set the function security (mutable reference version for conditional building)
Sourcepub fn set_body(&mut self, body: impl Into<String>)
pub fn set_body(&mut self, body: impl Into<String>)
Set the function body (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 function (mutable reference version for conditional building)
Sourcepub fn get_schema(&self) -> Option<&str>
pub fn get_schema(&self) -> Option<&str>
Get the schema name
Sourcepub fn get_parameters(&self) -> &[ProcedureParameter]
pub fn get_parameters(&self) -> &[ProcedureParameter]
Get the parameters in the function
Sourcepub fn get_return_type(&self) -> Option<&str>
pub fn get_return_type(&self) -> Option<&str>
Get the return type
Sourcepub fn get_language(&self) -> Option<&ProcedureLanguage>
pub fn get_language(&self) -> Option<&ProcedureLanguage>
Get the function language
Sourcepub fn get_volatility(&self) -> Option<&FunctionVolatility>
pub fn get_volatility(&self) -> Option<&FunctionVolatility>
Get the function volatility
Sourcepub fn get_security(&self) -> Option<&FunctionSecurity>
pub fn get_security(&self) -> Option<&FunctionSecurity>
Get the function security
Sourcepub fn get_comment(&self) -> Option<&str>
pub fn get_comment(&self) -> Option<&str>
Get the comment
Sourcepub fn parameter_count(&self) -> usize
pub fn parameter_count(&self) -> usize
Get the number of parameters in the function
Sourcepub fn has_parameter(&self, param_name: &str) -> bool
pub fn has_parameter(&self, param_name: &str) -> bool
Check if the function has a specific parameter
Sourcepub fn get_parameter(&self, param_name: &str) -> Option<&ProcedureParameter>
pub fn get_parameter(&self, param_name: &str) -> Option<&ProcedureParameter>
Get a specific parameter by name
Sourcepub fn has_schema(&self) -> bool
pub fn has_schema(&self) -> bool
Check if the function has a schema
Sourcepub fn has_return_type(&self) -> bool
pub fn has_return_type(&self) -> bool
Check if the function has a return type
Sourcepub fn has_language(&self) -> bool
pub fn has_language(&self) -> bool
Check if the function has a language
Sourcepub fn has_volatility(&self) -> bool
pub fn has_volatility(&self) -> bool
Check if the function has a volatility
Sourcepub fn has_security(&self) -> bool
pub fn has_security(&self) -> bool
Check if the function has a security setting
Sourcepub fn has_comment(&self) -> bool
pub fn has_comment(&self) -> bool
Check if the function has a comment
Sourcepub fn has_parameters(&self) -> bool
pub fn has_parameters(&self) -> bool
Check if the function has parameters
Trait Implementations§
Source§impl Clone for FunctionBuilder
impl Clone for FunctionBuilder
Source§fn clone(&self) -> FunctionBuilder
fn clone(&self) -> FunctionBuilder
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 FunctionBuilder
impl ConditionalBuilder for FunctionBuilder
Source§impl Debug for FunctionBuilder
impl Debug for FunctionBuilder
Source§impl InspectableBuilder for FunctionBuilder
impl InspectableBuilder for FunctionBuilder
Source§impl SchemaBuilder for FunctionBuilder
impl SchemaBuilder for FunctionBuilder
Source§type Output = StoredFunction
type Output = StoredFunction
Source§type Error = FunctionBuildError
type Error = FunctionBuildError
Source§impl ValidatableBuilder for FunctionBuilder
impl ValidatableBuilder for FunctionBuilder
Auto Trait Implementations§
impl Freeze for FunctionBuilder
impl RefUnwindSafe for FunctionBuilder
impl Send for FunctionBuilder
impl Sync for FunctionBuilder
impl Unpin for FunctionBuilder
impl UnsafeUnpin for FunctionBuilder
impl UnwindSafe for FunctionBuilder
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