From 96d400ca1275bf8444e5ad4dc6c8a06b01c3ea9d Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Mon, 24 Apr 2023 19:00:04 +0200 Subject: add auto create dirs, database and default config --- src/db.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/db.rs') diff --git a/src/db.rs b/src/db.rs index 2ffcff5..36fab75 100644 --- a/src/db.rs +++ b/src/db.rs @@ -701,11 +701,9 @@ pub fn s_insert_column( Ok(()) } -pub fn db_setup(config: Cfg) -> MLE<()> { - println!("Initiating database"); +pub fn db_setup(path: &str) -> MLE<()> { - let data = format!("{}/data.db", config.data); - let connection = Connection::open(data)?; + let connection = Connection::open(path)?; connection.execute_batch( "CREATE TABLE 'user_config' ( 'id' TEXT, 'value' TEXT ); -- cgit v1.2.3