feat: now GetUser returnes all the image info
All checks were successful
Build and Deploy Go App / build (push) Successful in 5m36s
Build and Deploy Go App / deploy (push) Successful in 27s

This commit is contained in:
Iron_Felix 2025-11-25 04:15:46 +03:00
parent 673ce48fac
commit 3aafab36c2
6 changed files with 63 additions and 33 deletions

View file

@ -9,9 +9,19 @@ VALUES ($1, $2)
RETURNING id, storage_type, image_path;
-- name: GetUserByID :one
SELECT id, avatar_id, mail, nickname, disp_name, user_desc, creation_date
FROM users
WHERE id = $1;
SELECT
t.id as id,
t.avatar_id as avatar_id,
t.mail as mail,
t.nickname as nickname,
t.disp_name as disp_name,
t.user_desc as user_desc,
t.creation_date as creation_date,
i.storage_type as storage_type,
i.image_path as image_path
FROM users as t
LEFT JOIN images as i ON (t.avatar_id = i.id)
WHERE id = sqlc.arg('id')::bigint;
-- name: GetStudioByID :one