From 3c710c33677d91bc2fe26e72721538f1e943a115 Mon Sep 17 00:00:00 2001 From: phoenix Date: Mon, 20 Oct 2025 13:03:05 -0400 Subject: [PATCH] tsk-70: Saving changes --- src/lib.rs | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 19c66a2..9c6d32f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,36 +1,2 @@ // TODO: Get rid of this file and place the code in more appropriate places -pub mod callers; -pub mod config; -pub mod hashing; -pub mod repo; -pub mod token_stuff; -mod connection_settings { - pub const MAXCONN: u32 = 5; -} - -pub mod db { - - use sqlx::postgres::PgPoolOptions; - - use crate::connection_settings; - - pub async fn create_pool() -> Result { - let database_url = icarus_envy::environment::get_db_url().await.value; - println!("Database url: {database_url}"); - - PgPoolOptions::new() - .max_connections(connection_settings::MAXCONN) - .connect(&database_url) - .await - } - - pub async fn migrations(pool: &sqlx::PgPool) { - // Run migrations using the sqlx::migrate! macro - // Assumes your migrations are in a ./migrations folder relative to Cargo.toml - sqlx::migrate!("./migrations") - .run(pool) - .await - .expect("Failed to run migrations"); - } -}