Skip to main content

SQLValueCatalog

Trait SQLValueCatalog 

Source
pub trait SQLValueCatalog {
    // Required methods
    fn enum_type_labels(
        &self,
        type_oid: u32,
    ) -> Result<Option<Arc<EnumTypeLabels>>>;
    fn enum_label_uncommitted(&self, label_oid: u32) -> bool;
    fn enum_type_name(&self, type_oid: u32) -> Result<Option<String>>;
    fn has_enum_types(&self) -> bool;

    // Provided methods
    fn value_type_by_oid(&self, _oid: u32) -> Result<Option<ColumnType>> { ... }
    fn value_composite_type(
        &self,
        _oid: u32,
    ) -> Result<Option<Arc<CompositeTypeDescriptor>>> { ... }
    fn enum_type_comparison_states(&self) -> Option<&EnumTypeComparisonStates> { ... }
    fn enum_value_by_oid(&self, _label_oid: u32) -> Result<Option<EnumValue>> { ... }
    fn enum_label_position(
        &self,
        _label_oid: u32,
    ) -> Result<Option<(u32, usize)>> { ... }
}
Expand description

Type metadata and enum support used to observe already admitted SQL values. Implementations borrow one statement catalog generation and never invoke type input.

Required Methods§

Source

fn enum_type_labels(&self, type_oid: u32) -> Result<Option<Arc<EnumTypeLabels>>>

The labels of one enum type in the statement’s catalog generation, or None when the catalog has no such type.

Source

fn enum_label_uncommitted(&self, label_oid: u32) -> bool

Whether the current transaction added this label to a type that it did not create. PostgreSQL rejects such a label until the transaction commits.

Source

fn enum_type_name(&self, type_oid: u32) -> Result<Option<String>>

format_type_be of the type, which qualifies a type hidden by the search path.

Source

fn has_enum_types(&self) -> bool

Whether the statement catalog defines any enum type; binding skips enum literal validation otherwise.

Provided Methods§

Source

fn value_type_by_oid(&self, _oid: u32) -> Result<Option<ColumnType>>

The declared type for a physical OID, including domains, arrays and composites.

Source

fn value_composite_type( &self, _oid: u32, ) -> Result<Option<Arc<CompositeTypeDescriptor>>>

The current descriptor of an admitted composite value.

Source

fn enum_type_comparison_states(&self) -> Option<&EnumTypeComparisonStates>

The session’s comparison support functions, shared by declared type across nested array and record calls. Pure catalog readers do not own runtime state.

Source

fn enum_value_by_oid(&self, _label_oid: u32) -> Result<Option<EnumValue>>

Resolve an already admitted physical label OID across enum types. Output uses the label’s actual identity even if a retained tuple now declares another enum type; it does not repeat input safety checks.

Source

fn enum_label_position(&self, _label_oid: u32) -> Result<Option<(u32, usize)>>

The actual enum type and zero-based label position of an admitted physical OID in this generation. Positions have declaration/key order and avoid copying label keys for comparison.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§