diff options
Diffstat (limited to 'backend/query.sql')
| -rw-r--r-- | backend/query.sql | 18 |
1 files changed, 18 insertions, 0 deletions
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; |
