Skip to main content

CreateFunction

Struct CreateFunction 

Source
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: String

Lower-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: bool

STRICT / RETURNS NULL ON NULL INPUT - the function is not invoked when any input argument is NULL; the result is NULL.

§owner: String

Catalog owner. The compiler leaves this empty and registration captures the effective current user; persisted definitions always carry a role name.

§security: RoutineSecurityAttributes

Execution identity and leakproofness, flattened to retain the catalog-definition wire shape.

§parallel: FunctionParallel

Parallel-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

Source

pub fn identity_params(&self) -> Vec<&FunctionParam>

Parameters that define routine identity: IN + INOUT + VARIADIC, in declaration order.

Source

pub fn identity_arity(&self) -> usize

Number of parameters that define routine identity.

Source

pub fn call_params(&self) -> Vec<&FunctionParam>

Parameters supplied by a call: identity parameters for functions and every non-TABLE parameter for procedures.

Source

pub fn call_arity(&self) -> usize

Number of declared call parameters; a variadic parameter can consume multiple actual arguments.

Source

pub fn required_call_arity(&self) -> usize

Minimum number of actual arguments for ordinary expanded notation; a variadic parameter accepts zero elements.

Source

pub fn signature_arity(&self) -> usize

Backward-compatible alias for Self::call_arity.

Source

pub fn required_arity(&self) -> usize

Backward-compatible alias for Self::required_call_arity.

Source

pub fn signature_params(&self) -> Vec<&FunctionParam>

Backward-compatible alias for Self::call_params.

Source

pub fn output_params(&self) -> Vec<&FunctionParam>

Parameters that shape the result row: OUT + INOUT + RETURNS TABLE columns, in declaration order.

Source

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

Source§

fn clone(&self) -> CreateFunction

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CreateFunction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CreateFunction

Source§

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 Serialize for CreateFunction

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.