begin implementing repository for accessing database

This commit is contained in:
Nico
2025-09-17 21:54:01 +02:00
parent 3252d45409
commit 094ec0aa09
3 changed files with 13 additions and 0 deletions

View File

@@ -27,7 +27,9 @@ async fn db_version(app_handle: tauri::AppHandle) -> Result<String, String> {
.await
.map_err(|e| e.to_string())?;
sqlx::migrate!("./migrations").run(&pool).await.map_err(|e| e.to_string())?;
let row: (String,) = sqlx::query_as("SELECT sqlite_version()")
.fetch_one(&pool)

View File

View File

@@ -0,0 +1,11 @@
use sqlx::sqlite::{SqlitePool};
pub struct PathRepository<'a> {
pub pool: &'a SqlitePool,
}
impl<'a> PathRepository<'a> {
pub fn get_path_by_id(&self, id: i32) -> Result<Path>{
}
}