From 611d93ea8a5dcc7dd92ec412e8fb28078438b31b Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Wed, 17 Sep 2025 00:45:46 +0900
Subject: feat(backend): add admin pages for submissions

---
 backend/query.sql | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

(limited to 'backend/query.sql')

diff --git a/backend/query.sql b/backend/query.sql
index 9baf593..0d84652 100644
--- a/backend/query.sql
+++ b/backend/query.sql
@@ -258,3 +258,21 @@ WHERE testcase_id = $1;
 -- name: DeleteTestcase :exec
 DELETE FROM testcases
 WHERE testcase_id = $1;
+
+-- name: GetSubmissionsByGameID :many
+SELECT *
+FROM submissions
+WHERE game_id = $1
+ORDER BY created_at DESC;
+
+-- name: GetSubmissionByID :one
+SELECT *
+FROM submissions
+WHERE submission_id = $1
+LIMIT 1;
+
+-- name: GetTestcaseResultsBySubmissionID :many
+SELECT *
+FROM testcase_results
+WHERE submission_id = $1
+ORDER BY created_at;
-- 
cgit v1.3.1

