2024-05-17 23:23:22 +05:30
|
|
|
// SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
|
|
|
//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};
|
|
|
|
|
|
|
|
pub mod create_verification_secret;
|
2024-05-18 18:28:34 +05:30
|
|
|
pub mod delete_verification_secret;
|
2024-05-17 23:23:22 +05:30
|
|
|
pub mod email_exists;
|
|
|
|
mod errors;
|
2024-05-18 19:01:29 +05:30
|
|
|
pub mod get_verification_secret;
|
2024-05-19 00:39:01 +05:30
|
|
|
pub mod user_view;
|
2024-05-17 23:23:22 +05:30
|
|
|
pub mod username_exists;
|
2024-05-18 18:28:34 +05:30
|
|
|
pub mod verification_secret_exists;
|
2024-05-17 23:23:22 +05:30
|
|
|
|
|
|
|
#[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()))
|
|
|
|
}
|
|
|
|
}
|