25 lines
517 B
Rust
25 lines
517 B
Rust
//use crate::auth::application::port::out::db::save_oauth_state::SaveOAuthState;
|
|
use std::sync::Arc;
|
|
|
|
use sqlx::postgres::PgPool;
|
|
|
|
use crate::db::{migrate::RunMigrations, sqlx_postgres::Postgres};
|
|
|
|
mod errors;
|
|
mod save_oauth_state;
|
|
|
|
#[derive(Clone)]
|
|
pub struct DBOutPostgresAdapter {
|
|
pool: PgPool,
|
|
}
|
|
|
|
impl DBOutPostgresAdapter {
|
|
pub fn new(pool: PgPool) -> Self {
|
|
Self { pool }
|
|
}
|
|
|
|
pub fn migratable(&self) -> Arc<dyn RunMigrations> {
|
|
Arc::new(Postgres::new(self.pool.clone()))
|
|
}
|
|
}
|