connectorx::sources

Trait PartitionParser

Source
pub trait PartitionParser<'a>: Send {
    type TypeSystem: TypeSystem;
    type Error: From<ConnectorXError> + Send + Debug;

    // Required method
    fn fetch_next(&mut self) -> Result<(usize, bool), Self::Error>;

    // Provided method
    fn parse<'r, T>(
        &'r mut self,
    ) -> Result<T, <Self as PartitionParser<'a>>::Error>
       where T: TypeAssoc<Self::TypeSystem>,
             Self: Produce<'r, T, Error = <Self as PartitionParser<'a>>::Error> { ... }
}

Required Associated Types§

Required Methods§

Source

fn fetch_next(&mut self) -> Result<(usize, bool), Self::Error>

Fetch next batch of rows from database, return (number of rows fetched to local, whether all rows are fechted from database). There might be rows that are not consumed yet when calling the next fetch_next. The function might be called even after the last batch is fetched.

Provided Methods§

Source

fn parse<'r, T>(&'r mut self) -> Result<T, <Self as PartitionParser<'a>>::Error>
where T: TypeAssoc<Self::TypeSystem>, Self: Produce<'r, T, Error = <Self as PartitionParser<'a>>::Error>,

Read a value T by calling Produce<T>::produce. Usually this function does not need to be implemented.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl PartitionParser<'_> for PostgresSimpleSourceParser

Source§

impl<'a> PartitionParser<'a> for BigQuerySourceParser

Source§

impl<'a> PartitionParser<'a> for CSVSourcePartitionParser<'a>

Source§

impl<'a> PartitionParser<'a> for DummySourcePartitionParser<'a>

Source§

impl<'a> PartitionParser<'a> for MsSQLSourceParser<'a>

Source§

impl<'a> PartitionParser<'a> for MySQLBinarySourceParser<'a>

Source§

impl<'a> PartitionParser<'a> for MySQLTextSourceParser<'a>

Source§

impl<'a> PartitionParser<'a> for OracleTextSourceParser<'a>

Source§

impl<'a> PartitionParser<'a> for PostgresBinarySourcePartitionParser<'a>

Source§

impl<'a> PartitionParser<'a> for PostgresCSVSourceParser<'a>

Source§

impl<'a> PartitionParser<'a> for PostgresRawSourceParser<'a>

Source§

impl<'a> PartitionParser<'a> for SQLiteSourcePartitionParser<'a>

Source§

impl<'a> PartitionParser<'a> for TrinoSourcePartitionParser<'a>