Trait connectorx::sources::Source

source ·
pub trait Source {
    type TypeSystem: TypeSystem;
    type Partition: SourcePartition<TypeSystem = Self::TypeSystem, Error = Self::Error> + Send;
    type Error: From<ConnectorXError> + Send + Debug;

    const DATA_ORDERS: &'static [DataOrder];

    // Required methods
    fn set_data_order(
        &mut self,
        data_order: DataOrder,
    ) -> Result<(), Self::Error>;
    fn set_queries<Q: ToString>(&mut self, queries: &[CXQuery<Q>]);
    fn set_origin_query(&mut self, query: Option<String>);
    fn fetch_metadata(&mut self) -> Result<(), Self::Error>;
    fn result_rows(&mut self) -> Result<Option<usize>, Self::Error>;
    fn names(&self) -> Vec<String>;
    fn schema(&self) -> Vec<Self::TypeSystem>;
    fn partition(self) -> Result<Vec<Self::Partition>, Self::Error>;
}

Required Associated Types§

source

type TypeSystem: TypeSystem

The type system this Source associated with.

source

type Partition: SourcePartition<TypeSystem = Self::TypeSystem, Error = Self::Error> + Send

source

type Error: From<ConnectorXError> + Send + Debug

Required Associated Constants§

source

const DATA_ORDERS: &'static [DataOrder]

Supported data orders, ordering by preference.

Required Methods§

source

fn set_data_order(&mut self, data_order: DataOrder) -> Result<(), Self::Error>

source

fn set_queries<Q: ToString>(&mut self, queries: &[CXQuery<Q>])

source

fn set_origin_query(&mut self, query: Option<String>)

source

fn fetch_metadata(&mut self) -> Result<(), Self::Error>

source

fn result_rows(&mut self) -> Result<Option<usize>, Self::Error>

Get total number of rows if available

source

fn names(&self) -> Vec<String>

source

fn schema(&self) -> Vec<Self::TypeSystem>

source

fn partition(self) -> Result<Vec<Self::Partition>, Self::Error>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Source for BigQuerySource

source§

impl Source for CSVSource

source§

impl Source for DummySource

source§

impl Source for MsSQLSource

source§

impl Source for OracleSource

source§

impl Source for SQLiteSource

source§

impl Source for TrinoSource

source§

impl<P> Source for MySQLSource<P>

source§

impl<P, C> Source for PostgresSource<P, C>
where PostgresSourcePartition<P, C>: SourcePartition<TypeSystem = PostgresTypeSystem, Error = PostgresSourceError>, P: Send, C: MakeTlsConnect<Socket> + Clone + 'static + Sync + Send, C::TlsConnect: Send, C::Stream: Send, <C::TlsConnect as TlsConnect<Socket>>::Future: Send,