Skip to content

Commit

Permalink
Fix config instance
Browse files Browse the repository at this point in the history
  • Loading branch information
onihilist committed Jul 12, 2024
1 parent 0d97aa8 commit 686860e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/database/database.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use std::panic::resume_unwind;
use crate::config::{configToml, configTomlDatabase};
use crate::config::{configToml, configTomlDatabase, configTomlServer};
use tokio_postgres::{NoTls, Row};
use crate::server::users::userData;
use crate::utils;

const CONFIG: configToml = configToml::new();

pub async fn connectToDB() -> Result<tokio_postgres::Client, tokio_postgres::Error> {

let db: configTomlDatabase = CONFIG.database.unwrap();
let db: configTomlDatabase = configToml::new().database.unwrap();
//let server: configTomlServer = CONFIG.server.unwrap();
//println!("{}", server.maxUser);

let connection_string = format!("host={} port={} user={} password={}", // dbname={}",
db.host,
Expand Down

0 comments on commit 686860e

Please sign in to comment.