aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/query.sql
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-03-21 11:37:48 +0900
committernsfisis <nsfisis@gmail.com>2025-03-21 11:37:48 +0900
commit95903269b252729ee6573a5b607d98fa0223cd9a (patch)
treecfed9b4320cb5c0f83364fbe8e5517b59bb10d73 /backend/query.sql
parent4b58aed45bb2356786958b4ce10b62ede26dfdb3 (diff)
downloadphperkaigi-2025-albatross-95903269b252729ee6573a5b607d98fa0223cd9a.tar.gz
phperkaigi-2025-albatross-95903269b252729ee6573a5b607d98fa0223cd9a.tar.zst
phperkaigi-2025-albatross-95903269b252729ee6573a5b607d98fa0223cd9a.zip
fix(frontend): fix submission status flickering
Diffstat (limited to 'backend/query.sql')
-rw-r--r--backend/query.sql6
1 files changed, 6 insertions, 0 deletions
diff --git a/backend/query.sql b/backend/query.sql
index 32f9273..2d56c1c 100644
--- a/backend/query.sql
+++ b/backend/query.sql
@@ -156,6 +156,12 @@ VALUES ($1, $2, $3, $4)
ON CONFLICT (game_id, user_id)
DO UPDATE SET code = EXCLUDED.code;
+-- name: UpdateCodeAndStatus :exec
+INSERT INTO game_states (game_id, user_id, code, status)
+VALUES ($1, $2, $3, $4)
+ON CONFLICT (game_id, user_id)
+DO UPDATE SET code = EXCLUDED.code, status = EXCLUDED.status;
+
-- name: CreateSubmission :one
INSERT INTO submissions (game_id, user_id, code, code_size, status)
VALUES ($1, $2, $3, $4, 'running')