ForgeFlux/src/auth/adapter/out/db/postgres/mod.rs
Aravinth Manivannan 44512bc616
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
chore: mv src/forge/auth src/auth
2024-05-06 10:31:38 +05:30

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()))
}
}