windows paths

This commit is contained in:
2025-11-14 10:11:11 +01:00
parent e435be4d94
commit ec2a2ef44d
2 changed files with 14 additions and 9 deletions
+3 -2
View File
@@ -2,7 +2,7 @@ use std::path::Path;
use lanspread_db::db::Game;
use serde::{Deserialize, Serialize};
use sqlx::sqlite::SqlitePool;
use sqlx::sqlite::{SqliteConnectOptions, SqlitePoolOptions};
#[derive(Clone, Debug, Serialize, Deserialize, sqlx::FromRow)]
pub struct EtiGame {
@@ -23,7 +23,8 @@ pub struct EtiGame {
/// # Errors
pub async fn get_games(db: &Path) -> eyre::Result<Vec<EtiGame>> {
let pool = SqlitePool::connect(format!("sqlite:{}", db.to_string_lossy()).as_str()).await?;
let options = SqliteConnectOptions::new().filename(db).read_only(true);
let pool = SqlitePoolOptions::new().connect_with(options).await?;
let mut games = sqlx::query_as::<_, EtiGame>(
"SELECT