pub struct StoredFunction {
pub name: String,
pub schema: Option<String>,
pub parameters: Vec<ProcedureParameter>,
pub return_type: Option<String>,
pub language: ProcedureLanguage,
pub body: String,
pub volatility: FunctionVolatility,
pub security: FunctionSecurity,
pub strict: bool,
}Expand description
Represents a PostgreSQL stored function
Fields§
§name: String§schema: Option<String>§parameters: Vec<ProcedureParameter>§return_type: Option<String>§language: ProcedureLanguage§body: String§volatility: FunctionVolatility§security: FunctionSecurity§strict: boolImplementations§
Source§impl StoredFunction
impl StoredFunction
Sourcepub fn qualified_name(&self) -> String
pub fn qualified_name(&self) -> String
Get the fully qualified name
Sourcepub fn with_schema(self, schema: impl Into<String>) -> Self
pub fn with_schema(self, schema: impl Into<String>) -> Self
Set schema
Sourcepub fn with_parameter(self, param: ProcedureParameter) -> Self
pub fn with_parameter(self, param: ProcedureParameter) -> Self
Add parameter
Sourcepub fn with_return_type(self, return_type: impl Into<String>) -> Self
pub fn with_return_type(self, return_type: impl Into<String>) -> Self
Set return type
Sourcepub fn with_language(self, language: ProcedureLanguage) -> Self
pub fn with_language(self, language: ProcedureLanguage) -> Self
Set language
Sourcepub fn with_volatility(self, volatility: FunctionVolatility) -> Self
pub fn with_volatility(self, volatility: FunctionVolatility) -> Self
Set volatility
Sourcepub fn with_security(self, security: FunctionSecurity) -> Self
pub fn with_security(self, security: FunctionSecurity) -> Self
Set security mode
Sourcepub fn with_strict(self, strict: bool) -> Self
pub fn with_strict(self, strict: bool) -> Self
Mark function as strict (returns NULL if any parameter is NULL)
Sourcepub fn generate_create_ddl(&self) -> String
pub fn generate_create_ddl(&self) -> String
Generate CREATE FUNCTION DDL
Sourcepub fn generate_drop_ddl(&self) -> String
pub fn generate_drop_ddl(&self) -> String
Generate DROP FUNCTION DDL
Trait Implementations§
Source§impl Clone for StoredFunction
impl Clone for StoredFunction
Source§fn clone(&self) -> StoredFunction
fn clone(&self) -> StoredFunction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StoredFunction
impl Debug for StoredFunction
Source§impl<'de> Deserialize<'de> for StoredFunction
impl<'de> Deserialize<'de> for StoredFunction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StoredFunction
impl PartialEq for StoredFunction
Source§impl Serialize for StoredFunction
impl Serialize for StoredFunction
impl StructuralPartialEq for StoredFunction
Auto Trait Implementations§
impl Freeze for StoredFunction
impl RefUnwindSafe for StoredFunction
impl Send for StoredFunction
impl Sync for StoredFunction
impl Unpin for StoredFunction
impl UnsafeUnpin for StoredFunction
impl UnwindSafe for StoredFunction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
Converts
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>
Converts
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