From 62f614acb804f40e5d078293368fae3c873c518c Mon Sep 17 00:00:00 2001 From: LinlyBoi Date: Mon, 18 Dec 2023 00:20:35 +0200 Subject: [PATCH] till I figure out how async actually works --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index bb38de6..7610c58 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,12 @@ async fn main() -> std::io::Result<()> { dotenv().ok(); std::env::set_var("RUST_LOG", "debug"); env_logger::init(); + let database_url = env::var("DATABASE_URL").expect("Put a DB url in the .env file dumbass"); + let pool = sqlx::postgres::PgPoolOptions::new() + .max_connections(10) + .connect(database_url.as_str()) + .await + .expect("No pool connection man :("); HttpServer::new(|| { App::new() .service(echo)