add tests

This commit is contained in:
2023-10-01 13:48:21 +02:00
parent 7500b90b22
commit 6d0501d3b0
4 changed files with 209 additions and 10 deletions

View File

@ -294,6 +294,16 @@ ORDER BY departure DESC
.unwrap();
}
#[cfg(test)]
pub async fn highest_id(db: &SqlitePool) -> i32 {
sqlx::query!("SELECT max(id) as id FROM logbook")
.fetch_one(db)
.await
.unwrap()
.id
.unwrap()
}
pub async fn home(
&self,
db: &SqlitePool,