From fe0d0196f133bd902b176aa02119b7f2a49ebc35 Mon Sep 17 00:00:00 2001 From: Joris Date: Wed, 26 Jan 2022 14:31:42 +0100 Subject: Read database path from arguments --- src/db/db.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/db') diff --git a/src/db/db.rs b/src/db/db.rs index a3398e2..86614ec 100644 --- a/src/db/db.rs +++ b/src/db/db.rs @@ -9,8 +9,8 @@ use rusqlite::{params, Connection}; use rusqlite_migration::{Migrations, M}; use std::time::SystemTime; -pub fn init() -> Result { - let mut conn = Connection::open("database.db")?; +pub fn init(database: String) -> Result { + let mut conn = Connection::open(database)?; let migrations = Migrations::new(vec![M::up(include_str!("sql/1-init.sql"))]); migrations.to_latest(&mut conn)?; Ok(conn) -- cgit v1.2.3