Skip to main content

TableBoundCodec

Trait TableBoundCodec 

Source
pub(crate) trait TableBoundCodec: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn check_column_type(
        &self,
        data_type: &ConcreteDataType,
    ) -> PgWireResult<()>;
    fn create_parser(
        &self,
        columns: &[ColumnSchema],
        timezone: &str,
    ) -> PgWireResult<Box<dyn RecordParser + Send>>;
}
Expand description

A table-bound COPY format: records decode against the targeted table’s columns into insertable rows (csv, jsonl). Implemented by the codec config structs; the copy lifecycle treats these row-based formats identically through it. Arrow IPC uses a separate bulk-ingestion path.

Required Methods§

Source

fn name(&self) -> &'static str

The canonical format name, for logs.

Source

fn check_column_type(&self, data_type: &ConcreteDataType) -> PgWireResult<()>

Validates that a column of data_type can be ingested.

Source

fn create_parser( &self, columns: &[ColumnSchema], timezone: &str, ) -> PgWireResult<Box<dyn RecordParser + Send>>

Creates the stateful parser for one copy stream over the targeted columns (in COPY field order). timezone is the session timezone for offset-free timestamp strings.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§