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 chrono::{Datelike, NaiveDateTime, Utc};
use rocket::FromForm;
use serde::Serialize;
@ -160,7 +162,7 @@ impl Logbook {
",
id
)
.fetch_one(db)
.fetch_one(db.deref_mut())
.await
.ok()
}
@ -289,7 +291,7 @@ ORDER BY departure DESC
log.comments,
log.logtype
)
.fetch_one(&mut tx)
.fetch_one(tx.deref_mut())
.await.unwrap().id;
let logbook = Logbook::find_by_id_tx(&mut tx, inserted_row as i32)
@ -363,7 +365,7 @@ ORDER BY departure DESC
log.comments,
log.logtype
)
.fetch_one(&mut tx)
.fetch_one(tx.deref_mut())
.await.unwrap();
for rower in &log.rowers {
@ -398,7 +400,7 @@ ORDER BY departure DESC
async fn remove_rowers(&self, db: &mut Transaction<'_, Sqlite>) {
sqlx::query!("DELETE FROM rower WHERE logbook_id=?", self.id)
.execute(db)
.execute(db.deref_mut())
.await
.unwrap();
}
@ -495,7 +497,7 @@ ORDER BY departure DESC
log.arrival,
self.id
)
.execute(db)
.execute(db.deref_mut())
.await.unwrap(); //TODO: fixme
Ok(())