Skip to main content

ReadEngine

Trait ReadEngine 

Source
pub trait ReadEngine: Send + Sync {
    // Required methods
    fn query_arrow<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        sql: &'life1 str,
        params: &'life2 [DbValue],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<RecordBatch>, DbkitError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn load_table<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        batches: Vec<RecordBatch>,
    ) -> Pin<Box<dyn Future<Output = Result<(), DbkitError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn drop_table<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), DbkitError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

An analytical query engine that returns columnar Arrow data.

Required Methods§

Source

fn query_arrow<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, sql: &'life1 str, params: &'life2 [DbValue], ) -> Pin<Box<dyn Future<Output = Result<Vec<RecordBatch>, DbkitError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Run an analytical query and collect the result as Arrow batches.

Parameter support is engine-dependent: DuckDB binds params; DataFusion does not yet and returns an error if any are supplied.

Source

fn load_table<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, batches: Vec<RecordBatch>, ) -> Pin<Box<dyn Future<Output = Result<(), DbkitError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Materialize a named in-memory table from Arrow batches, replacing any existing table of the same name. An empty batches is a no-op.

Source

fn drop_table<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), DbkitError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Drop the named in-memory table if it exists. Dropping a table that was never loaded is a no-op, not an error.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§