From db806e76af5925a93693338461f2b68848709d1a Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Mon, 23 Feb 2026 03:14:22 +0100 Subject: [PATCH] Fixed init-db error --- src/user.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/user.rs b/src/user.rs index 133f7d1..00b631e 100644 --- a/src/user.rs +++ b/src/user.rs @@ -11,11 +11,15 @@ pub struct User { // Initialize SQLite connection pool pub async fn init_db() -> SqlitePool { - let pool = SqlitePool::connect("sqlite:users.db").await.unwrap(); + let pool = SqlitePool::connect("sqlite://users.db?mode=rwc") + .await + .expect("Failed to open database"); + sqlx::query(include_str!("schema.sql")) .execute(&pool) .await - .unwrap(); + .expect("Failed to run schema"); + pool }