rdbc_rs/future/prepare.rs
1use super::{stmt::Statement, ConnectionPool};
2
3/// The trait to create a prepared statment for later queries or executions.
4#[async_trait::async_trait]
5pub trait Preparable {
6 type DB: ConnectionPool + Sync + Send;
7 async fn prepare<S>(&mut self, query: S) -> anyhow::Result<Statement<Self::DB>>
8 where
9 S: Into<String> + Send;
10
11 fn driver_name(&self) -> &str;
12
13 fn conn_str(&self) -> &str;
14}