use crate::error::DbxResult;
pub trait DatabaseCore {
fn insert(&self, table: &str, key: &[u8], value: &[u8]) -> DbxResult<()>;
fn get(&self, table: &str, key: &[u8]) -> DbxResult<Option<Vec<u8>>>;
fn delete(&self, table: &str, key: &[u8]) -> DbxResult<()>;
fn scan(&self, table: &str) -> DbxResult<Vec<(Vec<u8>, Vec<u8>)>>;
fn flush(&self) -> DbxResult<()>;
fn insert_batch(&self, table: &str, entries: Vec<(Vec<u8>, Vec<u8>)>) -> DbxResult<()>;
}
pub trait DatabaseSql {
fn execute_sql(&self, sql: &str) -> DbxResult<Vec<arrow::record_batch::RecordBatch>>;
fn register_table(&self, name: &str, batches: Vec<arrow::record_batch::RecordBatch>);
fn append_batch(&self, table: &str, batch: arrow::record_batch::RecordBatch) -> DbxResult<()>;
}
pub trait DatabaseQuery {
}
pub trait DatabaseTransaction {
fn begin(
&self,
) -> DbxResult<crate::transaction::api::Transaction<'_, crate::transaction::api::Active>>;
}
pub trait DatabaseSnapshot {
fn save_to_file(&self, path: &str) -> DbxResult<()>;
fn load_from_file(path: &str) -> DbxResult<Self>
where
Self: Sized;
}