sqlx/sqlx-core/src/postgres/database.rs
Ryan Leckey cc9d443434
feat: re-introduce Transaction
* Transaction now wraps `&mut Connection` instead of `Connection`
2020-05-30 17:51:55 -07:00

35 lines
787 B
Rust

use crate::database::{Database, HasArguments, HasValueRef};
use crate::postgres::arguments::PgArgumentBuffer;
use crate::postgres::value::{PgValue, PgValueRef};
use crate::postgres::{PgArguments, PgConnection, PgRow, PgTransactionManager, PgTypeInfo};
/// PostgreSQL database driver.
#[derive(Debug)]
pub struct Postgres;
impl Database for Postgres {
type Connection = PgConnection;
type TransactionManager = PgTransactionManager;
type Row = PgRow;
type TypeInfo = PgTypeInfo;
type Value = PgValue;
}
impl<'r> HasValueRef<'r> for Postgres {
type Database = Postgres;
type ValueRef = PgValueRef<'r>;
}
impl HasArguments<'_> for Postgres {
type Database = Postgres;
type Arguments = PgArguments;
type ArgumentBuffer = PgArgumentBuffer;
}