aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/db/bots.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-01-01 11:26:49 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-01-01 11:26:49 +0100
commite145947d052450618af3ba094e66a27c3c7f86e4 (patch)
tree5aff15f6ffb98710323b0ebadb58f733e75cbead /planetwars-server/src/db/bots.rs
parent8d3b8fd8aa9603f5377f1b37963190ac2c01e9dd (diff)
downloadplanetwars.dev-e145947d052450618af3ba094e66a27c3c7f86e4.tar.xz
planetwars.dev-e145947d052450618af3ba094e66a27c3c7f86e4.zip
match form stubs
Diffstat (limited to 'planetwars-server/src/db/bots.rs')
-rw-r--r--planetwars-server/src/db/bots.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/planetwars-server/src/db/bots.rs b/planetwars-server/src/db/bots.rs
index eb66c05..bef69c0 100644
--- a/planetwars-server/src/db/bots.rs
+++ b/planetwars-server/src/db/bots.rs
@@ -34,6 +34,11 @@ pub fn find_bots_by_owner(owner_id: i32, conn: &PgConnection) -> QueryResult<Vec
.get_results(conn)
}
+pub fn find_all_bots(conn: &PgConnection) -> QueryResult<Vec<Bot>> {
+ // TODO: filter out bots that cannot be run (have no valid code bundle associated with them)
+ bots::table.get_results(conn)
+}
+
#[derive(Insertable)]
#[table_name = "code_bundles"]
pub struct NewCodeBundle<'a> {