use std::sync::Arc;
use crate::{DataPath, Result};
use arrow_array::RecordBatch;
use arrow_schema::SchemaRef;
use async_trait::async_trait;
#[derive(Debug, Clone)]
pub struct Dataset {
pub path: DataPath,
pub schema: SchemaRef,
pub total_records: usize,
pub total_bytes: usize,
}
#[async_trait]
pub trait Store: Send + Sync {
async fn list(&self) -> Result<Vec<Dataset>>;
async fn get(&self, path: &DataPath) -> Result<Dataset>;
async fn get_schema(&self, path: &DataPath) -> Result<SchemaRef>;
async fn get_batches(&self, path: &DataPath) -> Result<Vec<Arc<RecordBatch>>>;
async fn put(&self, path: DataPath, schema: SchemaRef, batches: Vec<RecordBatch>)
-> Result<()>;
async fn append_batches(&self, path: &DataPath, batches: Vec<RecordBatch>) -> Result<()>;
async fn truncate(&self, path: &DataPath) -> Result<()>;
async fn contains(&self, path: &DataPath) -> bool;
async fn remove(&self, path: &DataPath) -> Result<()>;
async fn create_schema(&self, name: &str) -> Result<()>;
async fn drop_schema(&self, name: &str) -> Result<bool>;
async fn list_schemas(&self) -> Result<Vec<String>>;
async fn schema_exists(&self, name: &str) -> bool;
}