From 922d9348cf59df248873e27af3b27dbb0d93d9b1 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 1 Aug 2024 21:36:47 +0900 Subject: refactor(backend): `Id` to `ID` in sqlc --- backend/db/query.sql.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'backend/db/query.sql.go') 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, -- cgit v1.2.3-70-g09d2