Trait mz_storage_client::types::sources::SourceConnection
source · pub trait SourceConnection: Debug + Clone + PartialEq {
// Required methods
fn name(&self) -> &'static str;
fn upstream_name(&self) -> Option<&str>;
fn timestamp_desc(&self) -> RelationDesc;
fn connection_id(&self) -> Option<GlobalId>;
fn metadata_columns(&self) -> Vec<(&str, ColumnType)>;
fn metadata_column_types(&self) -> Vec<IncludedColumnSource>;
// Provided method
fn alter_compatible(
&self,
id: GlobalId,
other: &Self
) -> Result<(), StorageError> { ... }
}
Expand description
A connection to an external system
Required Methods§
sourcefn upstream_name(&self) -> Option<&str>
fn upstream_name(&self) -> Option<&str>
The name of the resource in the external system (e.g kafka topic) if any
sourcefn timestamp_desc(&self) -> RelationDesc
fn timestamp_desc(&self) -> RelationDesc
The schema of this connection’s timestamp type. This will also be the schema of the progress relation.
sourcefn connection_id(&self) -> Option<GlobalId>
fn connection_id(&self) -> Option<GlobalId>
The id of the connection object (i.e the one obtained from running CREATE CONNECTION
) in
the catalog, if any.
sourcefn metadata_columns(&self) -> Vec<(&str, ColumnType)>
fn metadata_columns(&self) -> Vec<(&str, ColumnType)>
Returns available metadata columns that this connection offers in (name, type) pairs in the order specified by the user.
sourcefn metadata_column_types(&self) -> Vec<IncludedColumnSource>
fn metadata_column_types(&self) -> Vec<IncludedColumnSource>
The available metadata columns in the order specified by the user. This only identifies the kinds of columns that this source offers without any further information.
Provided Methods§
sourcefn alter_compatible(
&self,
id: GlobalId,
other: &Self
) -> Result<(), StorageError>
fn alter_compatible( &self, id: GlobalId, other: &Self ) -> Result<(), StorageError>
Determines if self
is compatible with another SourceConnection
, in
such a way that it is possible to turn self
into other
through a
valid series of transformations (e.g. no transformation or ALTER SOURCE
).
Note that the default implementation errors unless the two are equal. To support any modifying transformations, you must specify the implementation.