diff options
author | Joris | 2022-02-26 22:42:25 +0100 |
---|---|---|
committer | Joris | 2022-02-26 22:42:25 +0100 |
commit | 68285db2c187b350bb2b1707071382bd9fbaa2a5 (patch) | |
tree | be382be54bbaffd618af639728939cb88ed8e052 /src/db | |
parent | f9f49285c5ecc76d3edfb0a54ffab53c2e296d7f (diff) |
Give database path from argument
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<Connection> { - let mut conn = Connection::open("database.db")?; +pub fn init(db_path: &str) -> Result<Connection> { + 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) |