From edb3ead976cd51ab6d627fe6b36bb9f0be8a17d3 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sun, 27 Feb 2022 22:57:06 +0100 Subject: retrieve opponent from bots database --- planetwars-server/src/db/bots.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'planetwars-server/src/db') diff --git a/planetwars-server/src/db/bots.rs b/planetwars-server/src/db/bots.rs index baabd5a..d99a459 100644 --- a/planetwars-server/src/db/bots.rs +++ b/planetwars-server/src/db/bots.rs @@ -34,6 +34,10 @@ pub fn find_bots_by_owner(owner_id: i32, conn: &PgConnection) -> QueryResult QueryResult { + bots::table.filter(bots::name.eq(name)).first(conn) +} + pub fn find_all_bots(conn: &PgConnection) -> QueryResult> { // TODO: filter out bots that cannot be run (have no valid code bundle associated with them) bots::table.get_results(conn) -- cgit v1.2.3