From 68285db2c187b350bb2b1707071382bd9fbaa2a5 Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 26 Feb 2022 22:42:25 +0100 Subject: Give database path from argument --- src/db/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/db') diff --git a/src/db/mod.rs b/src/db/mod.rs index b27226b..1bbf21e 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -6,8 +6,8 @@ use uuid::Uuid; use crate::model::event::Event; -pub fn init() -> Result { - let mut conn = Connection::open("database.db")?; +pub fn init(db_path: &str) -> Result { + let mut conn = Connection::open(db_path)?; let migrations = Migrations::new(vec![M::up(include_str!("migrations/1-init.sql"))]); migrations.to_latest(&mut conn)?; Ok(conn) -- cgit v1.2.3