Skip to main content

FunctionTypeResolver

Trait FunctionTypeResolver 

Source
pub trait FunctionTypeResolver: Send + Sync {
Show 13 methods // Required method fn resolve_function_type( &self, name: &str, binding: Option<&FunctionBinding>, argument_names: &[Option<String>], argument_types: &[Option<ColumnType>], explicit_variadic: bool, ) -> Result<Option<ColumnType>, SQLError>; // Provided methods fn format_type_name(&self, ty: &ColumnType) -> Result<String, SQLError> { ... } fn has_untyped_function(&self, _name: &str) -> bool { ... } fn resolve_type_name( &self, _name: &str, ) -> Result<Option<ColumnType>, SQLError> { ... } fn resolve_collation_name( &self, _name: &str, ) -> Result<Option<u32>, SQLError> { ... } fn enum_labels(&self) -> Option<&dyn EnumLabelCatalog> { ... } fn catalog_input_functions(&self) -> Option<&dyn CatalogInputFunctions> { ... } fn composite_types(&self) -> Option<&dyn CompositeTypeCatalog> { ... } fn require_type_usage(&self, _ty: &ColumnType) -> Result<(), SQLError> { ... } fn resolve_function_overload( &self, _name: &str, _binding: Option<&FunctionBinding>, _argument_names: &[Option<String>], _argument_types: &[Option<ColumnType>], _explicit_variadic: bool, ) -> Result<Option<ResolvedFunctionOverload>, SQLError> { ... } fn is_scalar_function_binding( &self, _binding: &FunctionBinding, ) -> Result<bool, SQLError> { ... } fn resolve_function_overload_with_builtins( &self, name: &str, binding: Option<&FunctionBinding>, argument_names: &[Option<String>], argument_types: &[Option<ColumnType>], explicit_variadic: bool, _builtins: &[BuiltinFunctionOverload], ) -> Result<Option<ResolvedFunctionOverload>, SQLError> { ... } fn resolve_scalar_subquery_type( &self, _subquery: SubqueryId, _outer_schema: &RowSchema, _params: &[SQLParam], ) -> Result<Option<ColumnType>, SQLError> { ... }
}

Required Methods§

Source

fn resolve_function_type( &self, name: &str, binding: Option<&FunctionBinding>, argument_names: &[Option<String>], argument_types: &[Option<ColumnType>], explicit_variadic: bool, ) -> Result<Option<ColumnType>, SQLError>

Provided Methods§

Source

fn format_type_name(&self, ty: &ColumnType) -> Result<String, SQLError>

Format a selected type using the binding catalog’s namespace visibility.

Source

fn has_untyped_function(&self, _name: &str) -> bool

Return whether an external runtime callback claims this unbound function name without exposing a declared SQL return type. Such callbacks must retain dispatch precedence instead of being rebound to a same-named built-in overload.

Source

fn resolve_type_name(&self, _name: &str) -> Result<Option<ColumnType>, SQLError>

Resolve a catalog-owned SQL type name that is not represented by the built-in ColumnType::from_sql_name mapping, such as a domain.

Source

fn resolve_collation_name(&self, _name: &str) -> Result<Option<u32>, SQLError>

Resolve an explicit collation name with the binding catalog’s namespace visibility and privileges.

Source

fn enum_labels(&self) -> Option<&dyn EnumLabelCatalog>

Enum labels of the binding catalog. Binding converts unknown literals coerced to an enum type with them, as PostgreSQL parse analysis calls the type’s input function.

Source

fn catalog_input_functions(&self) -> Option<&dyn CatalogInputFunctions>

Input functions whose catalog constraints must run when an unknown literal is analyzed. Callers retain the returned constant; metadata-only inference does not invoke this capability.

Source

fn composite_types(&self) -> Option<&dyn CompositeTypeCatalog>

Composite type attributes of the binding catalog, which type field selections and row coercions.

Source

fn require_type_usage(&self, _ty: &ColumnType) -> Result<(), SQLError>

Require the current user’s USAGE privilege on a type that a relation column, domain or routine declares, as object_aclcheck(TypeRelationId, ..., ACL_USAGE) and aclcheck_error_type require it; see crate::catalog::security::type_inquiry::usage_governing_type. A resolver without roles and type privileges has nothing to deny.

Source

fn resolve_function_overload( &self, _name: &str, _binding: Option<&FunctionBinding>, _argument_names: &[Option<String>], _argument_types: &[Option<ColumnType>], _explicit_variadic: bool, ) -> Result<Option<ResolvedFunctionOverload>, SQLError>

Resolve a catalog-backed overload together with the stable binding needed to execute it after built-in and user-defined candidates have been ranked.

Source

fn is_scalar_function_binding( &self, _binding: &FunctionBinding, ) -> Result<bool, SQLError>

Return whether an exact catalog-selected binding can execute in a scalar expression. The conservative default prevents aggregate, procedure, and set-returning routines from being attached to ScalarExpr::Func.

Source

fn resolve_function_overload_with_builtins( &self, name: &str, binding: Option<&FunctionBinding>, argument_names: &[Option<String>], argument_types: &[Option<ColumnType>], explicit_variadic: bool, _builtins: &[BuiltinFunctionOverload], ) -> Result<Option<ResolvedFunctionOverload>, SQLError>

Resolve catalog-backed routines and the supplied built-in overloads as one PostgreSQL candidate set. Implementations with catalog visibility should override this so search-path shadowing and unknown-category selection happen before a winner is chosen.

Source

fn resolve_scalar_subquery_type( &self, _subquery: SubqueryId, _outer_schema: &RowSchema, _params: &[SQLParam], ) -> Result<Option<ColumnType>, SQLError>

Resolve the declared first-column type of a physical scalar-subquery slot when the owning execution context carries its plan arena.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§