pub struct CreateFunction {Show 19 fields
pub object_id: Option<[u8; 16]>,
pub name: String,
pub or_replace: bool,
pub is_procedure: bool,
pub params: Vec<FunctionParam>,
pub returns: FunctionReturns,
pub return_type_reference: Option<RoutineColumnTypeReference>,
pub language: String,
pub body: FunctionBody,
pub creation_search_path: Vec<String>,
pub volatility: FunctionVolatility,
pub strict: bool,
pub owner: String,
pub security: RoutineSecurityAttributes,
pub parallel: FunctionParallel,
pub support: Option<String>,
pub config: Vec<(String, String)>,
pub config_actions: Vec<RoutineConfigAction>,
pub execute_acl: Option<Vec<RoutineAclEntry>>,
}Expand description
CREATE [OR REPLACE] FUNCTION | PROCEDURE.
Fields§
§object_id: Option<[u8; 16]>Stable catalog identity. The engine assigns this once when the routine is created and preserves it across replacement and rename.
name: String§or_replace: bool§is_procedure: bool§params: Vec<FunctionParam>§returns: FunctionReturns§return_type_reference: Option<RoutineColumnTypeReference>Parsed %TYPE identity for a scalar or set return declaration until registration resolves it.
language: StringLower-cased language name (plpgsql, sql).
body: FunctionBody§creation_search_path: Vec<String>Effective schema search path captured when a SQL-standard body or parameter default is catalog-bound. String and PL/pgSQL bodies keep dynamic lookup, but their parameter defaults still use this captured path.
volatility: FunctionVolatility§strict: boolSTRICT / RETURNS NULL ON NULL INPUT - the function is not
invoked when any input argument is NULL; the result is NULL.
owner: StringCatalog owner. The compiler leaves this empty and registration captures the effective current user; persisted definitions always carry a role name.
security: RoutineSecurityAttributesExecution identity and leakproofness, flattened to retain the catalog-definition wire shape.
parallel: FunctionParallelParallel-safety classification.
support: Option<String>Optional planner support routine identity.
config: Vec<(String, String)>Effective per-routine configuration as name=value pairs in declaration order.
config_actions: Vec<RoutineConfigAction>Creation-time configuration actions awaiting engine/session resolution. Registration consumes this list before persistence.
execute_acl: Option<Vec<RoutineAclEntry>>Explicit execution privileges. None means the PostgreSQL default (PUBLIC=EXECUTE).
Implementations§
Source§impl CreateFunction
impl CreateFunction
Sourcepub fn identity_params(&self) -> Vec<&FunctionParam>
pub fn identity_params(&self) -> Vec<&FunctionParam>
Parameters that define routine identity: IN + INOUT + VARIADIC, in declaration order.
Sourcepub fn identity_arity(&self) -> usize
pub fn identity_arity(&self) -> usize
Number of parameters that define routine identity.
Sourcepub fn call_params(&self) -> Vec<&FunctionParam>
pub fn call_params(&self) -> Vec<&FunctionParam>
Parameters supplied by a call: identity parameters for functions and every non-TABLE parameter for procedures.
Sourcepub fn call_arity(&self) -> usize
pub fn call_arity(&self) -> usize
Number of declared call parameters; a variadic parameter can consume multiple actual arguments.
Sourcepub fn required_call_arity(&self) -> usize
pub fn required_call_arity(&self) -> usize
Minimum number of actual arguments for ordinary expanded notation; a variadic parameter accepts zero elements.
Sourcepub fn signature_arity(&self) -> usize
pub fn signature_arity(&self) -> usize
Backward-compatible alias for Self::call_arity.
Sourcepub fn required_arity(&self) -> usize
pub fn required_arity(&self) -> usize
Backward-compatible alias for Self::required_call_arity.
Sourcepub fn signature_params(&self) -> Vec<&FunctionParam>
pub fn signature_params(&self) -> Vec<&FunctionParam>
Backward-compatible alias for Self::call_params.
Sourcepub fn output_params(&self) -> Vec<&FunctionParam>
pub fn output_params(&self) -> Vec<&FunctionParam>
Parameters that shape the result row: OUT + INOUT +
RETURNS TABLE columns, in declaration order.
Sourcepub fn returns_set(&self) -> bool
pub fn returns_set(&self) -> bool
True when the routine produces a row set (RETURNS SETOF /
RETURNS TABLE).
Trait Implementations§
Source§impl Clone for CreateFunction
impl Clone for CreateFunction
Source§fn clone(&self) -> CreateFunction
fn clone(&self) -> CreateFunction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CreateFunction
impl Debug for CreateFunction
Source§impl<'de> Deserialize<'de> for CreateFunction
impl<'de> Deserialize<'de> for CreateFunction
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>,
Auto Trait Implementations§
impl Freeze for CreateFunction
impl RefUnwindSafe for CreateFunction
impl Send for CreateFunction
impl Sync for CreateFunction
impl Unpin for CreateFunction
impl UnsafeUnpin for CreateFunction
impl UnwindSafe for CreateFunction
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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