From 64d53a5f51a891b8794e646b59b1252a177fd780 Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 3 Dec 2024 00:15:23 +0100 Subject: [PATCH] fix: proper Option query --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3265f7a..9983119 100644 --- a/src/main.rs +++ b/src/main.rs @@ -224,7 +224,7 @@ impl Database { async fn services(&self) -> rusqlite::Result> { let db = self.0.lock().await; - let mut stmt = db.prepare("SELECT * FROM services")?; + let mut stmt = db.prepare("SELECT id, name FROM services")?; let res = stmt.query_map( params![], |row| Ok((row.get(0)?, row.get(1)?)) @@ -282,7 +282,7 @@ impl Database { let mut stmt = db.prepare("SELECT value FROM events WHERE service = :sid AND time > :time")?; stmt.query_row( named_params! { ":sid": sid, ":time": since }, - |row| row.get(0).optional() + |row| row.get::>(0) ) } }