pub static MYSQL_CONFIGS_TEST: MysqlConfig = MysqlConfig {
host: String::new(),
port: 3306,
user: String::new(),
password: String::new(),
database: String::new(),
table_prefix: String::new(),
};
pub struct MysqlConfig
{
pub host:String,
pub port:i32,
pub user:String,
pub password:String,
pub database:String,
pub table_prefix:String,
}
impl MysqlConfig {
pub fn get_dns(&self)->String{
format!(
"mysql://{}:{}@{}:{}/{}?ssl-mode=disabled",
self.user,
self.password,
self.host,
self.port,
self.database
)
}
}