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§
Sourcefn check_column_type(&self, data_type: &ConcreteDataType) -> PgWireResult<()>
fn check_column_type(&self, data_type: &ConcreteDataType) -> PgWireResult<()>
Validates that a column of data_type can be ingested.
Sourcefn create_parser(
&self,
columns: &[ColumnSchema],
timezone: &str,
) -> PgWireResult<Box<dyn RecordParser + Send>>
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".