diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-01 21:36:47 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-01 21:37:42 +0900 |
| commit | 922d9348cf59df248873e27af3b27dbb0d93d9b1 (patch) | |
| tree | c0ec259659fc0244c22750a7e18451efbe13446d /backend/db/query.sql.go | |
| parent | f6443042fbec1bd394439904f3c69e23709f7e6a (diff) | |
| download | phperkaigi-2025-albatross-922d9348cf59df248873e27af3b27dbb0d93d9b1.tar.gz phperkaigi-2025-albatross-922d9348cf59df248873e27af3b27dbb0d93d9b1.tar.zst phperkaigi-2025-albatross-922d9348cf59df248873e27af3b27dbb0d93d9b1.zip | |
refactor(backend): `Id` to `ID` in sqlc
Diffstat (limited to 'backend/db/query.sql.go')
| -rw-r--r-- | backend/db/query.sql.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/backend/db/query.sql.go b/backend/db/query.sql.go index b5fef29..074e767 100644 --- a/backend/db/query.sql.go +++ b/backend/db/query.sql.go @@ -11,14 +11,14 @@ import ( "github.com/jackc/pgx/v5/pgtype" ) -const getGameById = `-- name: GetGameById :one +const getGameByID = `-- name: GetGameByID :one SELECT game_id, state, display_name, duration_seconds, created_at, started_at, games.problem_id, problems.problem_id, title, description FROM games LEFT JOIN problems ON games.problem_id = problems.problem_id WHERE games.game_id = $1 LIMIT 1 ` -type GetGameByIdRow struct { +type GetGameByIDRow struct { GameID int32 State string DisplayName string @@ -31,9 +31,9 @@ type GetGameByIdRow struct { Description *string } -func (q *Queries) GetGameById(ctx context.Context, gameID int32) (GetGameByIdRow, error) { - row := q.db.QueryRow(ctx, getGameById, gameID) - var i GetGameByIdRow +func (q *Queries) GetGameByID(ctx context.Context, gameID int32) (GetGameByIDRow, error) { + row := q.db.QueryRow(ctx, getGameByID, gameID) + var i GetGameByIDRow err := row.Scan( &i.GameID, &i.State, @@ -87,14 +87,14 @@ func (q *Queries) GetUserAuthByUsername(ctx context.Context, username string) (G return i, err } -const getUserById = `-- name: GetUserById :one +const getUserByID = `-- name: GetUserByID :one SELECT user_id, username, display_name, icon_path, is_admin, created_at FROM users WHERE users.user_id = $1 LIMIT 1 ` -func (q *Queries) GetUserById(ctx context.Context, userID int32) (User, error) { - row := q.db.QueryRow(ctx, getUserById, userID) +func (q *Queries) GetUserByID(ctx context.Context, userID int32) (User, error) { + row := q.db.QueryRow(ctx, getUserByID, userID) var i User err := row.Scan( &i.UserID, |
