Compare commits

..

3 commits

Author SHA1 Message Date
497e4039ec
Merge branch 'auth' into dev
All checks were successful
Build and Deploy Go App / build (push) Successful in 6m40s
Build and Deploy Go App / deploy (push) Successful in 35s
2025-11-27 12:05:59 +03:00
6cbf0afb33
feat: use postgres to fetch and store user info 2025-11-27 09:42:05 +03:00
79e8ece948
cicd: removed go mod tidy for go builds 2025-11-27 06:42:07 +03:00

View file

@ -281,6 +281,29 @@ func (q *Queries) GetUserByID(ctx context.Context, id int64) (GetUserByIDRow, er
return i, err
}
const getUserByNickname = `-- name: GetUserByNickname :one
SELECT id, avatar_id, passhash, mail, nickname, disp_name, user_desc, creation_date, last_login
FROM users
WHERE nickname = $1
`
func (q *Queries) GetUserByNickname(ctx context.Context, nickname string) (User, error) {
row := q.db.QueryRow(ctx, getUserByNickname, nickname)
var i User
err := row.Scan(
&i.ID,
&i.AvatarID,
&i.Passhash,
&i.Mail,
&i.Nickname,
&i.DispName,
&i.UserDesc,
&i.CreationDate,
&i.LastLogin,
)
return i, err
}
const getUserTitleByID = `-- name: GetUserTitleByID :one
SELECT
ut.user_id, ut.title_id, ut.status, ut.rate, ut.review_id, ut.ctime,