Skip to content

Commit

Permalink
Fix SQL parameter style for SQLite
Browse files Browse the repository at this point in the history
The query uses PostgreSQL-style positional parameters ($1, $2) while the codebase uses SQLite. This will cause runtime errors as SQLite expects ?1, ?2 style parameters.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
grunch and coderabbitai[bot] authored Dec 26, 2024
1 parent 5975a56 commit fef0fe7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ pub async fn add_new_user(pool: &SqlitePool, new_user: User) -> anyhow::Result<(
let result = sqlx::query(
"
INSERT INTO users (pubkey, is_admin, is_solver, is_banned, category, last_trade_index, total_reviews, total_rating, last_rating, max_rating, min_rating, created_at)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12)
",
)
.bind(new_user.pubkey)
Expand Down

0 comments on commit fef0fe7

Please sign in to comment.