wicked-waifus-rs/shorekeeper-database/src/config.rs
2024-09-11 19:37:46 +03:00

20 lines
464 B
Rust

use serde::Deserialize;
use std::fmt;
#[derive(Deserialize, Debug)]
pub struct DatabaseSettings {
pub host: String,
pub user_name: String,
pub password: String,
pub db_name: String,
}
impl fmt::Display for DatabaseSettings {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"postgres://{}:{}@{}/{}",
&self.user_name, &self.password, &self.host, &self.db_name
)
}
}