diff --git a/src/db.rs b/src/db.rs index dd7d1b5..f0b36bd 100644 --- a/src/db.rs +++ b/src/db.rs @@ -6,9 +6,6 @@ use tracing::instrument; use crate::secrets::UserToken; -// TODO: allow configuring this via envar -const DB_URI_DEFAULT: &str = "sqlite://sqlite.db"; - // TODO: check again if it's possible to pass this as a parameter to query! // const TABLE_USER_TOKENS: &str = "user_tokens"; @@ -38,8 +35,8 @@ pub struct SqliteDatabase { impl SqliteDatabase { #[instrument] - pub async fn open() -> Self { - let options = SqliteConnectOptions::from_str(DB_URI_DEFAULT) + pub async fn open(connection_string: &str) -> Self { + let options = SqliteConnectOptions::from_str(connection_string) .expect("Invalid database URI") .create_if_missing(true);