use std::path::Path;
use std::sync::Arc;
use crate::adapters::contract::models::TableName;
use crate::adapters::session::errors::SessionError;
pub trait CallerSession: Send + Sync + std::fmt::Debug {
fn execute(&self, statement: &str) -> Result<(), SessionError>;
fn query_text(&self, query: &str) -> Result<Vec<Vec<Option<String>>>, SessionError>;
fn copy_in(&self, statement: &str, data: &[u8]) -> Result<(), SessionError> {
let _ = (statement, data);
Err(SessionError::new("this session cannot run COPY FROM STDIN"))
}
fn load_parquet(&self, table: &TableName, file: &Path) -> Result<(), SessionError> {
let _ = (table, file);
Err(SessionError::new("this session cannot load Parquet files"))
}
}
pub trait CallerConnection: Send + Sync + std::fmt::Debug {
fn open(&self) -> Result<Arc<dyn CallerSession>, SessionError>;
fn describe(&self) -> String;
}