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§
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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,
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".