16 lines
335 B
Rust
16 lines
335 B
Rust
|
|
use sqlx::{PgConnection, Postgres, pool::PoolConnection};
|
||
|
|
|
||
|
|
pub struct AppDbClient {
|
||
|
|
pub(crate) conn: PoolConnection<Postgres>,
|
||
|
|
}
|
||
|
|
|
||
|
|
impl AppDbClient {
|
||
|
|
pub fn from_pool_conn(conn: PoolConnection<Postgres>) -> Self {
|
||
|
|
Self { conn }
|
||
|
|
}
|
||
|
|
|
||
|
|
pub fn get_conn(&mut self) -> &mut PgConnection {
|
||
|
|
&mut self.conn
|
||
|
|
}
|
||
|
|
}
|