use crate::Result;
use crate::udbc::value::Value;
use async_trait::async_trait;
use std::collections::HashMap;
#[async_trait]
pub trait Connection: Send {
async fn query(
&mut self,
sql: &str,
args: &[(String, Value)],
) -> Result<Vec<HashMap<String, Value>>>;
async fn execute(&mut self, sql: &str, args: &[(String, Value)]) -> Result<u64>;
async fn last_insert_id(&mut self) -> Result<u64>;
async fn begin(&mut self) -> Result<()>;
async fn commit(&mut self) -> Result<()>;
async fn rollback(&mut self) -> Result<()>;
}