diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-22 14:19:42 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-22 14:19:42 +0200 |
commit | 72acfb93627918f6fc9c68a5bf5b4ecf34d07a23 (patch) | |
tree | e59a493e573b05a4fc5a09f3c6d2702635410bec /src/app.rs | |
parent | perf(raw_update.py)!: Don't fetch entries that are already in the database (diff) | |
download | yt-72acfb93627918f6fc9c68a5bf5b4ecf34d07a23.tar.gz yt-72acfb93627918f6fc9c68a5bf5b4ecf34d07a23.zip |
test(benches/update): Init
Diffstat (limited to 'src/app.rs')
-rw-r--r-- | src/app.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/app.rs b/src/app.rs index 14b85a3..f956251 100644 --- a/src/app.rs +++ b/src/app.rs @@ -8,19 +8,17 @@ // You should have received a copy of the License along with this program. // If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +use std::path::PathBuf; + use anyhow::{Context, Result}; use sqlx::{query, sqlite::SqliteConnectOptions, SqlitePool}; -use crate::constants; - pub struct App { pub database: SqlitePool, } impl App { - pub async fn new() -> Result<Self> { - let db_name = constants::database()?; - + pub async fn new(db_name: PathBuf) -> Result<Self> { let options = SqliteConnectOptions::new() .filename(db_name) .optimize_on_close(true, None) |