aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/db/query.sql.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-03-10 00:25:42 +0900
committernsfisis <nsfisis@gmail.com>2025-03-10 00:25:42 +0900
commitc807d6e47b11a91ec56225ed8358e3f2ef903e5c (patch)
tree9eee9b70f5c063a9c9e887919fc12f9ac38ca6c2 /backend/db/query.sql.go
parent87ffe8514a1cdd48ce1660c63c021e5f30540184 (diff)
downloadphperkaigi-2025-albatross-c807d6e47b11a91ec56225ed8358e3f2ef903e5c.tar.gz
phperkaigi-2025-albatross-c807d6e47b11a91ec56225ed8358e3f2ef903e5c.tar.zst
phperkaigi-2025-albatross-c807d6e47b11a91ec56225ed8358e3f2ef903e5c.zip
refactor(backend): remove unused db queries
Diffstat (limited to 'backend/db/query.sql.go')
-rw-r--r--backend/db/query.sql.go65
1 files changed, 0 insertions, 65 deletions
diff --git a/backend/db/query.sql.go b/backend/db/query.sql.go
index 980928a..a7b8f74 100644
--- a/backend/db/query.sql.go
+++ b/backend/db/query.sql.go
@@ -326,19 +326,6 @@ func (q *Queries) GetRanking(ctx context.Context, gameID int32) ([]GetRankingRow
return items, nil
}
-const getSubmissionCodeSizeByID = `-- name: GetSubmissionCodeSizeByID :one
-SELECT code_size FROM submissions
-WHERE submission_id = $1
-LIMIT 1
-`
-
-func (q *Queries) GetSubmissionCodeSizeByID(ctx context.Context, submissionID int32) (int32, error) {
- row := q.db.QueryRow(ctx, getSubmissionCodeSizeByID, submissionID)
- var code_size int32
- err := row.Scan(&code_size)
- return code_size, err
-}
-
const getUserAuthByUsername = `-- name: GetUserAuthByUsername :one
SELECT users.user_id, username, display_name, icon_path, is_admin, created_at, user_auth_id, user_auths.user_id, auth_type, password_hash FROM users
JOIN user_auths ON users.user_id = user_auths.user_id
@@ -444,32 +431,6 @@ func (q *Queries) ListAllGames(ctx context.Context) ([]Game, error) {
return items, nil
}
-const listMainPlayerIDs = `-- name: ListMainPlayerIDs :many
-SELECT user_id FROM game_main_players
-WHERE game_id = $1
-ORDER BY user_id
-`
-
-func (q *Queries) ListMainPlayerIDs(ctx context.Context, gameID int32) ([]int32, error) {
- rows, err := q.db.Query(ctx, listMainPlayerIDs, gameID)
- if err != nil {
- return nil, err
- }
- defer rows.Close()
- var items []int32
- for rows.Next() {
- var user_id int32
- if err := rows.Scan(&user_id); err != nil {
- return nil, err
- }
- items = append(items, user_id)
- }
- if err := rows.Err(); err != nil {
- return nil, err
- }
- return items, nil
-}
-
const listMainPlayers = `-- name: ListMainPlayers :many
SELECT game_id, game_main_players.user_id, users.user_id, username, display_name, icon_path, is_admin, created_at FROM game_main_players
JOIN users ON game_main_players.user_id = users.user_id
@@ -572,32 +533,6 @@ func (q *Queries) ListPublicGames(ctx context.Context) ([]ListPublicGamesRow, er
return items, nil
}
-const listTestcaseIDsByGameID = `-- name: ListTestcaseIDsByGameID :many
-SELECT testcases.testcase_id FROM testcases
-WHERE testcases.problem_id = (SELECT problem_id FROM games WHERE game_id = $1)
-ORDER BY testcases.testcase_id
-`
-
-func (q *Queries) ListTestcaseIDsByGameID(ctx context.Context, gameID int32) ([]int32, error) {
- rows, err := q.db.Query(ctx, listTestcaseIDsByGameID, gameID)
- if err != nil {
- return nil, err
- }
- defer rows.Close()
- var items []int32
- for rows.Next() {
- var testcase_id int32
- if err := rows.Scan(&testcase_id); err != nil {
- return nil, err
- }
- items = append(items, testcase_id)
- }
- if err := rows.Err(); err != nil {
- return nil, err
- }
- return items, nil
-}
-
const listTestcasesByGameID = `-- name: ListTestcasesByGameID :many
SELECT testcase_id, problem_id, stdin, stdout FROM testcases
WHERE testcases.problem_id = (SELECT problem_id FROM games WHERE game_id = $1)