Skip to content

Commit

Permalink
Fix db string (#105)
Browse files Browse the repository at this point in the history
* Some improvements on config file and db file

* small fix on db string for connection

---------

Co-authored-by: Arkanoider <[email protected]>
Co-authored-by: arkanoider <[email protected]>
  • Loading branch information
3 people authored Sep 1, 2023
1 parent 5e8af3b commit 6731680
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ use crate::settings::Settings;

pub async fn connect() -> Result<Pool<Sqlite>, sqlx::Error> {
let db_settings = Settings::get_db();
let db_url = db_settings.url;
let mut db_url = db_settings.url;
db_url.push_str("mostro.db");
if !Sqlite::database_exists(&db_url).await.unwrap_or(false) {
panic!("Not database found, please create a new one first!");
}
Expand Down

0 comments on commit 6731680

Please sign in to comment.