aboutsummaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/db')
-rw-r--r--src/db/mod.rs4
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)