mod batch;
mod error;
mod schema;
mod value;
pub use batch::{DbBatch, DbStatementResult, StmtId};
pub use error::DbError;
pub use schema::{DbColumnDescription, DbTableDescriptor, DbType};
pub use value::{DbRow, DbValue, ValueBinder};
use async_trait::async_trait;
use crate::dialect::SqlDialect;
#[async_trait]
pub trait Db: Send + Sync {
fn dialect(&self) -> SqlDialect;
async fn describe_table(&self, name: &str) -> Result<Option<DbTableDescriptor>, DbError>;
async fn exec(&self, sql: &str, params: &[DbValue]) -> Result<usize, DbError>;
async fn query(&self, sql: &str, params: &[DbValue]) -> Result<Vec<DbRow>, DbError>;
fn new_batch(&self) -> Box<dyn DbBatch>;
}