pub trait SyncSourceAdapter: Send + Sync {
// Required method
fn column_to_ir(
&self,
column: &ColumnSchema,
native_full_type: Option<&str>,
) -> IRColumn;
// Provided methods
fn table_to_ir(
&self,
schema: &TableSchema,
full_types: Option<&HashMap<String, String>>,
) -> IRTable { ... }
fn full_column_types_query(&self, _table: &str) -> Option<String> { ... }
fn table_options_query(&self, _table: &str) -> Option<String> { ... }
}Expand description
Converts native column metadata into IR (used for the source side of a sync).
Required Methods§
Sourcefn column_to_ir(
&self,
column: &ColumnSchema,
native_full_type: Option<&str>,
) -> IRColumn
fn column_to_ir( &self, column: &ColumnSchema, native_full_type: Option<&str>, ) -> IRColumn
Convert a single column to its IR representation.
native_full_type carries the fully-qualified type string with precision
(e.g. PostgreSQL’s format_type() output). When None, the adapter
falls back to column.data_type.
Provided Methods§
Sourcefn table_to_ir(
&self,
schema: &TableSchema,
full_types: Option<&HashMap<String, String>>,
) -> IRTable
fn table_to_ir( &self, schema: &TableSchema, full_types: Option<&HashMap<String, String>>, ) -> IRTable
Convert an entire TableSchema to an IRTable.
The default implementation iterates over columns and delegates to
column_to_ir.
Sourcefn full_column_types_query(&self, _table: &str) -> Option<String>
fn full_column_types_query(&self, _table: &str) -> Option<String>
Optional SQL returning (col_name, full_type) rows for precision-preserving sync.
Default: none (host uses column.data_type only).
Sourcefn table_options_query(&self, _table: &str) -> Option<String>
fn table_options_query(&self, _table: &str) -> Option<String>
Optional SQL returning a single row whose first column is a CREATE TABLE suffix
(e.g. ClickHouse ENGINE = MergeTree\nORDER BY (id)).
Default: none.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".