diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-09-05 21:12:03 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-09-05 21:12:03 +0900 |
| commit | 2fb0b6516b9731ca832a31f6b31515f4eb056cb1 (patch) | |
| tree | e2f4f82d783799f84a111179075e3da11cdb9e80 /backend/db | |
| parent | 82d3cf35c3c6b85b48c94dd6301c8bf718669b8d (diff) | |
| download | iosdc-japan-2025-albatross-2fb0b6516b9731ca832a31f6b31515f4eb056cb1.tar.gz iosdc-japan-2025-albatross-2fb0b6516b9731ca832a31f6b31515f4eb056cb1.tar.zst iosdc-japan-2025-albatross-2fb0b6516b9731ca832a31f6b31515f4eb056cb1.zip | |
feat(backend): support swift language
Diffstat (limited to 'backend/db')
| -rw-r--r-- | backend/db/models.go | 1 | ||||
| -rw-r--r-- | backend/db/query.sql.go | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/backend/db/models.go b/backend/db/models.go index 9bb8ccb..c7d649c 100644 --- a/backend/db/models.go +++ b/backend/db/models.go @@ -36,6 +36,7 @@ type Problem struct { ProblemID int32 Title string Description string + Language *string SampleCode string } diff --git a/backend/db/query.sql.go b/backend/db/query.sql.go index d4e134f..f70cd29 100644 --- a/backend/db/query.sql.go +++ b/backend/db/query.sql.go @@ -128,7 +128,7 @@ func (q *Queries) CreateUserAuth(ctx context.Context, arg CreateUserAuthParams) } const getGameByID = `-- name: GetGameByID :one -SELECT game_id, game_type, is_public, display_name, duration_seconds, created_at, started_at, games.problem_id, problems.problem_id, title, description, sample_code FROM games +SELECT game_id, game_type, is_public, display_name, duration_seconds, created_at, started_at, games.problem_id, problems.problem_id, title, description, language, sample_code FROM games JOIN problems ON games.problem_id = problems.problem_id WHERE games.game_id = $1 LIMIT 1 @@ -146,6 +146,7 @@ type GetGameByIDRow struct { ProblemID_2 int32 Title string Description string + Language *string SampleCode string } @@ -164,6 +165,7 @@ func (q *Queries) GetGameByID(ctx context.Context, gameID int32) (GetGameByIDRow &i.ProblemID_2, &i.Title, &i.Description, + &i.Language, &i.SampleCode, ) return i, err @@ -575,7 +577,7 @@ func (q *Queries) ListMainPlayers(ctx context.Context, dollar_1 []int32) ([]List } const listPublicGames = `-- name: ListPublicGames :many -SELECT game_id, game_type, is_public, display_name, duration_seconds, created_at, started_at, games.problem_id, problems.problem_id, title, description, sample_code FROM games +SELECT game_id, game_type, is_public, display_name, duration_seconds, created_at, started_at, games.problem_id, problems.problem_id, title, description, language, sample_code FROM games JOIN problems ON games.problem_id = problems.problem_id WHERE is_public = true ORDER BY games.game_id @@ -593,6 +595,7 @@ type ListPublicGamesRow struct { ProblemID_2 int32 Title string Description string + Language *string SampleCode string } @@ -617,6 +620,7 @@ func (q *Queries) ListPublicGames(ctx context.Context) ([]ListPublicGamesRow, er &i.ProblemID_2, &i.Title, &i.Description, + &i.Language, &i.SampleCode, ); err != nil { return nil, err |
