Skip to content

Commit

Permalink
Add LIMIT 1 on fetch_one() db
Browse files Browse the repository at this point in the history
  • Loading branch information
grunch committed Dec 11, 2024
1 parent df2c53b commit 8eafef6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
"#,
)
Expand Down

0 comments on commit 8eafef6

Please sign in to comment.