use crate::DbkitError;
use crate::analytical::RecordBatch;
use crate::value::DbValue;
use async_trait::async_trait;
#[cfg(feature = "duckdb")]
pub mod duckdb;
#[cfg(feature = "datafusion")]
pub mod datafusion;
mod convert;
pub(crate) use convert::rows_to_record_batch;
#[async_trait]
pub trait ReadEngine: Send + Sync {
async fn query_arrow(
&self,
sql: &str,
params: &[DbValue],
) -> Result<Vec<RecordBatch>, DbkitError>;
async fn load_table(
&self,
name: &str,
batches: Vec<RecordBatch>,
) -> Result<(), DbkitError>;
async fn drop_table(&self, name: &str) -> Result<(), DbkitError>;
}