feat(cli): working dir

This commit is contained in:
thesimplekid
2024-06-24 12:20:35 +01:00
parent 732bed929e
commit 5123571687
8 changed files with 50 additions and 23 deletions

View File

@@ -1,6 +1,7 @@
//! SQLite Mint
use std::collections::HashMap;
use std::path::Path;
use std::str::FromStr;
use async_trait::async_trait;
@@ -23,7 +24,8 @@ pub struct MintSqliteDatabase {
}
impl MintSqliteDatabase {
pub async fn new(path: &str) -> Result<Self, Error> {
pub async fn new(path: &Path) -> Result<Self, Error> {
let path = path.to_str().ok_or(Error::InvalidDbPath)?;
let _conn = SqliteConnectOptions::from_str(path)?
.journal_mode(sqlx::sqlite::SqliteJournalMode::Wal)
.read_only(false)