Skip to main content

tank_postgres/
driver.rs

1use crate::{PostgresConnection, PostgresPrepared, PostgresSqlWriter, PostgresTransaction};
2use tank_core::Driver;
3
4/// Postgres driver.
5#[derive(Default, Debug)]
6pub struct PostgresDriver {}
7impl PostgresDriver {
8    pub const fn new() -> Self {
9        Self {}
10    }
11}
12
13impl Driver for PostgresDriver {
14    type Connection = PostgresConnection;
15    type SqlWriter = PostgresSqlWriter;
16    type Prepared = PostgresPrepared;
17    type Transaction<'c> = PostgresTransaction<'c>;
18
19    const NAME: &'static [&'static str] = &["postgres"];
20    fn sql_writer(&self) -> PostgresSqlWriter {
21        PostgresSqlWriter {}
22    }
23}