upgrade sqlx to 0.7 Fixes #76 restructure registrations
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m57s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
2023-11-22 13:19:31 +01:00
parent ab6ab4af8d
commit 7569798b00
11 changed files with 450 additions and 296 deletions

View File

@ -1,3 +1,5 @@
use std::ops::DerefMut;
use rocket::serde::{Deserialize, Serialize};
use rocket::FromForm;
use sqlx::{FromRow, Sqlite, SqlitePool, Transaction};
@ -75,7 +77,7 @@ impl Boat {
}
pub async fn find_by_id_tx(db: &mut Transaction<'_, Sqlite>, id: i32) -> Option<Self> {
sqlx::query_as!(Self, "SELECT * FROM boat WHERE id like ?", id)
.fetch_one(db)
.fetch_one(db.deref_mut())
.await
.ok()
}