Ported the project from sqlite to postgres
This commit is contained in:
parent
d397b5c1ed
commit
29c1fc8f82
23 changed files with 566 additions and 409 deletions
|
@ -79,7 +79,7 @@ pub async fn new_post(new_post: Json<NewPost>, state: Data<ServerState>) -> Resu
|
|||
let username = claims.sub.clone();
|
||||
|
||||
// This one is avoidable if we just store the user id in the token
|
||||
let userid = sqlx::query!("SELECT id FROM users WHERE username = ?", username)
|
||||
let userid = sqlx::query!("SELECT id FROM users WHERE username = $1", username)
|
||||
.fetch_one(&state.pool)
|
||||
.await
|
||||
.unwrap()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue