From 7b17c30ce2269e38fc79f1d9ef0df0942e919e2e Mon Sep 17 00:00:00 2001 From: philipp Date: Mon, 10 Jun 2024 11:00:54 +0200 Subject: [PATCH] fix boat select --- src/model/boat.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/model/boat.rs b/src/model/boat.rs index dd6d3e6..fe87f65 100644 --- a/src/model/boat.rs +++ b/src/model/boat.rs @@ -81,20 +81,20 @@ pub struct BoatToUpdate<'r> { impl Boat { pub async fn find_by_id(db: &SqlitePool, id: i32) -> Option { - sqlx::query_as!(Self, "SELECT * FROM boat WHERE id like ?", id) + sqlx::query_as!(Self, "SELECT id, name, amount_seats, location_id, owner, year_built, boatbuilder, default_shipmaster_only_steering, convert_handoperated_possible, default_destination, skull, external, deleted FROM boat WHERE id like ?", id) .fetch_one(db) .await .ok() } pub async fn find_by_id_tx(db: &mut Transaction<'_, Sqlite>, id: i32) -> Option { - sqlx::query_as!(Self, "SELECT * FROM boat WHERE id like ?", id) + sqlx::query_as!(Self, "SELECT id, name, amount_seats, location_id, owner, year_built, boatbuilder, default_shipmaster_only_steering, convert_handoperated_possible, default_destination, skull, external, deleted FROM boat WHERE id like ?", id) .fetch_one(db.deref_mut()) .await .ok() } pub async fn find_by_name(db: &SqlitePool, name: String) -> Option { - sqlx::query_as!(Self, "SELECT * FROM boat WHERE name like ?", name) + sqlx::query_as!(Self, "SELECT id, name, amount_seats, location_id, owner, year_built, boatbuilder, default_shipmaster_only_steering, convert_handoperated_possible, default_destination, skull, external, deleted FROM boat WHERE name like ?", name) .fetch_one(db) .await .ok() -- 2.45.2