From 8eafef686e5770fea2abe04e852090b9517494b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Calder=C3=B3n?= Date: Wed, 11 Dec 2024 17:35:07 -0300 Subject: [PATCH] Add LIMIT 1 on fetch_one() db --- src/db.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/db.rs b/src/db.rs index 9e8b5dab..1485b396 100644 --- a/src/db.rs +++ b/src/db.rs @@ -301,6 +301,7 @@ pub async fn find_solver_pubkey(pool: &SqlitePool, solver_npub: String) -> anyho SELECT * FROM users WHERE pubkey == ?1 AND is_solver == true + LIMIT 1 "#, ) .bind(solver_npub) @@ -315,7 +316,7 @@ pub async fn is_user_present(pool: &SqlitePool, public_key: String) -> anyhow::R r#" SELECT * FROM users - WHERE i0_pubkey == ?1 + WHERE pubkey == ?1 LIMIT 1 "#, )