pub struct Routine {
pub schema: CompactString,
pub name: CompactString,
pub description: Option<String>,
pub params: SmallVec<[RoutineParam; 4]>,
pub return_type: ReturnType,
pub volatility: Volatility,
pub is_variadic: bool,
pub executable: bool,
}Expand description
PostgreSQL function or procedure
Represents a callable routine with its parameters and return type.
Fields§
§schema: CompactStringSchema name
name: CompactStringFunction/procedure name
description: Option<String>Description from pg_description
params: SmallVec<[RoutineParam; 4]>Function parameters
return_type: ReturnTypeReturn type
volatility: VolatilityVolatility (immutable, stable, volatile)
is_variadic: boolWhether the function has a variadic parameter
executable: boolWhether EXECUTE is allowed (for current role)
Implementations§
Source§impl Routine
impl Routine
Sourcepub fn qi(&self) -> QualifiedIdentifier
pub fn qi(&self) -> QualifiedIdentifier
Get the qualified identifier for this routine
Sourcepub fn returns_scalar(&self) -> bool
pub fn returns_scalar(&self) -> bool
Check if function returns a scalar value
Sourcepub fn returns_set_of_scalar(&self) -> bool
pub fn returns_set_of_scalar(&self) -> bool
Check if function returns a set of scalar values
Sourcepub fn returns_single(&self) -> bool
pub fn returns_single(&self) -> bool
Check if function returns a single row (not a set)
Sourcepub fn returns_set(&self) -> bool
pub fn returns_set(&self) -> bool
Check if function returns a set of rows
Sourcepub fn returns_composite(&self) -> bool
pub fn returns_composite(&self) -> bool
Check if function returns a composite type (table row)
Sourcepub fn table_name(&self) -> Option<&str>
pub fn table_name(&self) -> Option<&str>
Get the table name if function returns a composite type
Sourcepub fn table_qi(&self) -> Option<&QualifiedIdentifier>
pub fn table_qi(&self) -> Option<&QualifiedIdentifier>
Get the table QI if function returns a composite type
Sourcepub fn is_return_type_alias(&self) -> bool
pub fn is_return_type_alias(&self) -> bool
Check if the return type is an alias (domain type)
Sourcepub fn required_params(&self) -> impl Iterator<Item = &RoutineParam>
pub fn required_params(&self) -> impl Iterator<Item = &RoutineParam>
Get required parameters (non-variadic, no default)
Sourcepub fn optional_params(&self) -> impl Iterator<Item = &RoutineParam>
pub fn optional_params(&self) -> impl Iterator<Item = &RoutineParam>
Get optional parameters (has default)
Sourcepub fn variadic_param(&self) -> Option<&RoutineParam>
pub fn variadic_param(&self) -> Option<&RoutineParam>
Get the variadic parameter if present
Sourcepub fn get_param(&self, name: &str) -> Option<&RoutineParam>
pub fn get_param(&self, name: &str) -> Option<&RoutineParam>
Get parameter by name
Sourcepub fn param_count(&self) -> usize
pub fn param_count(&self) -> usize
Count of all parameters
Sourcepub fn required_param_count(&self) -> usize
pub fn required_param_count(&self) -> usize
Count of required parameters
Sourcepub fn is_volatile(&self) -> bool
pub fn is_volatile(&self) -> bool
Check if this is a volatile function
Sourcepub fn is_immutable(&self) -> bool
pub fn is_immutable(&self) -> bool
Check if this is an immutable function