aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/db/bots.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-01-01 16:32:55 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-01-01 16:32:55 +0100
commitbdb77f97d6af5a59e80d2b2552cd6994754cbf29 (patch)
tree20bbc02edfe21f2dd75985976e273a97c809bb07 /planetwars-server/src/db/bots.rs
parent4a077c7c65eced447c45389acf05007dd571bf26 (diff)
downloadplanetwars.dev-bdb77f97d6af5a59e80d2b2552cd6994754cbf29.tar.xz
planetwars.dev-bdb77f97d6af5a59e80d2b2552cd6994754cbf29.zip
minimal port of start_match logic
Diffstat (limited to 'planetwars-server/src/db/bots.rs')
-rw-r--r--planetwars-server/src/db/bots.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/planetwars-server/src/db/bots.rs b/planetwars-server/src/db/bots.rs
index bef69c0..970dcf9 100644
--- a/planetwars-server/src/db/bots.rs
+++ b/planetwars-server/src/db/bots.rs
@@ -68,3 +68,10 @@ pub fn find_bot_code_bundles(bot_id: i32, conn: &PgConnection) -> QueryResult<Ve
.filter(code_bundles::bot_id.eq(bot_id))
.get_results(conn)
}
+
+pub fn active_code_bundle(bot_id: i32, conn: &PgConnection) -> QueryResult<CodeBundle> {
+ code_bundles::table
+ .filter(code_bundles::bot_id.eq(bot_id))
+ .order(code_bundles::created_at.desc())
+ .first(conn)
+}