diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-07-31 22:20:35 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-07-31 22:20:35 +0900 |
| commit | 4aff0feca72da0175dcecb44aca9b3e30c861bc5 (patch) | |
| tree | 253a3094f3606682982b91b9be7a03f1e4b3f723 /backend/db/query.sql.go | |
| parent | 715651d6d263c5f526e8e13a8e2bb032193c5218 (diff) | |
| parent | 3840c6d8e4261f182657b11ba55f61da04d70b28 (diff) | |
| download | phperkaigi-2025-albatross-4aff0feca72da0175dcecb44aca9b3e30c861bc5.tar.gz phperkaigi-2025-albatross-4aff0feca72da0175dcecb44aca9b3e30c861bc5.tar.zst phperkaigi-2025-albatross-4aff0feca72da0175dcecb44aca9b3e30c861bc5.zip | |
Merge branch 'feat/admin-games-page'
Diffstat (limited to 'backend/db/query.sql.go')
| -rw-r--r-- | backend/db/query.sql.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/backend/db/query.sql.go b/backend/db/query.sql.go index 404f5d9..b5fef29 100644 --- a/backend/db/query.sql.go +++ b/backend/db/query.sql.go @@ -242,6 +242,38 @@ func (q *Queries) ListUsers(ctx context.Context) ([]User, error) { return items, nil } +const updateGame = `-- name: UpdateGame :exec +UPDATE games +SET + state = $2, + display_name = $3, + duration_seconds = $4, + started_at = $5, + problem_id = $6 +WHERE game_id = $1 +` + +type UpdateGameParams struct { + GameID int32 + State string + DisplayName string + DurationSeconds int32 + StartedAt pgtype.Timestamp + ProblemID *int32 +} + +func (q *Queries) UpdateGame(ctx context.Context, arg UpdateGameParams) error { + _, err := q.db.Exec(ctx, updateGame, + arg.GameID, + arg.State, + arg.DisplayName, + arg.DurationSeconds, + arg.StartedAt, + arg.ProblemID, + ) + return err +} + const updateGameStartedAt = `-- name: UpdateGameStartedAt :exec UPDATE games SET started_at = $2 |
