vanikam/src/identity/adapters/output/db/postgres/mod.rs
Aravinth Manivannan 50bd3db7b3
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
ci/woodpecker/push/woodpecker Pipeline failed
fix: replace username with first and last name and use user_id UUID for primary keys
2024-07-14 21:00:20 +05:30

34 lines
831 B
Rust

// 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;
pub mod delete_verification_secret;
pub mod email_exists;
mod errors;
pub mod get_verification_secret;
pub mod user_id_exists;
pub mod user_view;
pub mod verification_secret_exists;
#[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()))
}
}