pub mod arrow_ipc;
pub mod backup;
pub mod cache;
pub mod columnar;
pub mod columnar_cache;
pub mod columnar_delta;
pub mod compression;
pub mod delta_store;
pub mod encryption;
pub mod erasure_coding;
pub mod gpu;
pub mod index;
pub mod kv_adapter;
pub mod manager;
pub mod memory_wos;
pub mod metadata;
pub mod native_wos;
pub mod parquet_io;
pub mod partition;
pub mod realtime_sync;
pub mod versioned_batch;
use crate::error::DbxResult;
use std::ops::RangeBounds;
pub trait StorageBackend: Send + Sync {
fn insert(&self, table: &str, key: &[u8], value: &[u8]) -> DbxResult<()>;
fn insert_batch(&self, table: &str, rows: Vec<(Vec<u8>, Vec<u8>)>) -> DbxResult<()> {
for (key, value) in rows {
self.insert(table, &key, &value)?;
}
Ok(())
}
fn get(&self, table: &str, key: &[u8]) -> DbxResult<Option<Vec<u8>>>;
fn delete(&self, table: &str, key: &[u8]) -> DbxResult<bool>;
fn scan<R: RangeBounds<Vec<u8>> + Clone>(
&self,
table: &str,
range: R,
) -> DbxResult<Vec<(Vec<u8>, Vec<u8>)>>;
fn scan_one<R: RangeBounds<Vec<u8>> + Clone>(
&self,
table: &str,
range: R,
) -> DbxResult<Option<(Vec<u8>, Vec<u8>)>>;
fn flush(&self) -> DbxResult<()>;
fn count(&self, table: &str) -> DbxResult<usize>;
fn table_names(&self) -> DbxResult<Vec<String>>;
}