summaryrefslogtreecommitdiff
path: root/src/database
diff options
context:
space:
mode:
authorniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2025-01-27 08:01:41 +0100
committerniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2025-01-27 08:02:56 +0100
commit9dd126957d74ec064ff1844e3f4403e068117e11 (patch)
tree4dc5abd6eb32f18926f17802ea7a779596b16a43 /src/database
parentc622eab39ac7dd9f794b5d60eb937e29c9b3bd6e (diff)
last minute changes
Diffstat (limited to 'src/database')
-rw-r--r--src/database/mod.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/database/mod.rs b/src/database/mod.rs
index 045cf23..ab30884 100644
--- a/src/database/mod.rs
+++ b/src/database/mod.rs
@@ -6,8 +6,8 @@ pub mod user;
use serde::{Deserialize, Serialize};
use sqlx::mysql::{MySqlPool, MySqlPoolOptions};
-use utoipa::ToSchema;
use std::env;
+use utoipa::ToSchema;
#[derive(Serialize, Deserialize, ToSchema)]
pub struct Delete {
@@ -23,11 +23,7 @@ impl DatabaseWrapper {
pub async fn new() -> Result<DatabaseWrapper, sqlx::Error> {
let pool: MySqlPool = MySqlPoolOptions::new()
.max_connections(10)
- .connect(
- env::var("DATABASE_URL")
- .expect("Environment variable DATABASE_URL is *probably not setted up!!")
- .as_str(),
- )
+ .connect(env!("DATABASE_URL"))
.await
.unwrap(); /* This will break in case of error. It's intended. */