use std::fmt::Debug;
use std::ops::Deref;
use std::sync::Arc;
pub use omnia::FutureResult;
use crate::host::{DataType, Row};
pub trait Connection: Debug + Send + Sync + 'static {
fn query(&self, query: String, params: Vec<DataType>) -> FutureResult<Vec<Row>>;
fn exec(&self, query: String, params: Vec<DataType>) -> FutureResult<u32>;
}
#[derive(Clone, Debug)]
pub struct ConnectionProxy(pub Arc<dyn Connection>);
impl Deref for ConnectionProxy {
type Target = Arc<dyn Connection>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[derive(Clone, Debug)]
pub struct Statement {
pub query: String,
pub params: Vec<DataType>,
}