Login endpoint (#20)
All checks were successful
Release Tagging / release (push) Successful in 32s
Rust Build / Check (push) Successful in 45s
Rust Build / Test Suite (push) Successful in 58s
Rust Build / Rustfmt (push) Successful in 30s
Rust Build / Clippy (push) Successful in 48s
Rust Build / build (push) Successful in 1m9s
Rust Build / Check (pull_request) Successful in 43s
Rust Build / Test Suite (pull_request) Successful in 1m1s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 47s
Rust Build / build (pull_request) Successful in 1m9s

Reviewed-on: #20
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
2025-04-07 01:22:57 +00:00
committed by phoenix
parent 332e9d3378
commit 3424d31151
10 changed files with 402 additions and 35 deletions

View File

@@ -2,6 +2,7 @@ pub mod callers;
pub mod config;
pub mod hashing;
pub mod repo;
pub mod token_stuff;
pub mod keys {
pub const DBURL: &str = "DATABASE_URL";
@@ -15,7 +16,7 @@ mod connection_settings {
pub const MAXCONN: u32 = 5;
}
pub mod db_pool {
pub mod db {
use sqlx::postgres::PgPoolOptions;
use std::env;
@@ -38,4 +39,13 @@ pub mod db_pool {
env::var(keys::DBURL).expect(keys::error::ERROR)
}
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");
}
}