feat: implemented /users/{id} api route

This commit is contained in:
nihonium 2025-10-26 02:34:45 +03:00
parent 71e2661fb9
commit 948e036e8c
Signed by: nihonium
GPG key ID: 0251623741027CFC
10 changed files with 381 additions and 982 deletions

View file

@ -1,17 +1,17 @@
-- name: GetImageByID :one
SELECT image_id, storage_type, image_path
SELECT id, storage_type, image_path
FROM images
WHERE image_id = $1;
WHERE id = $1;
-- -- name: CreateImage :one
-- INSERT INTO images (storage_type, image_path)
-- VALUES ($1, $2)
-- RETURNING image_id, storage_type, image_path;
-- name: CreateImage :one
INSERT INTO images (storage_type, image_path)
VALUES ($1, $2)
RETURNING id, storage_type, image_path;
-- -- name: GetUserByID :one
-- SELECT user_id, avatar_id, passhash, mail, nickname, disp_name, user_desc, creation_date
-- FROM users
-- WHERE user_id = $1;
-- name: GetUserByID :one
SELECT id, avatar_id, mail, nickname, disp_name, user_desc, creation_date
FROM users
WHERE id = $1;
-- -- name: ListUsers :many
-- SELECT user_id, avatar_id, passhash, mail, nickname, disp_name, user_desc, creation_date