feat: use postgres to fetch and store user info

This commit is contained in:
nihonium 2025-11-27 09:42:05 +03:00
parent 79e8ece948
commit 6cbf0afb33
Signed by: nihonium
GPG key ID: 0251623741027CFC
9 changed files with 175 additions and 42 deletions

11
modules/auth/queries.sql Normal file
View file

@ -0,0 +1,11 @@
-- name: GetUserByNickname :one
SELECT *
FROM users
WHERE nickname = sqlc.arg('nickname');
-- name: CreateNewUser :one
INSERT
INTO users (passhash, nickname)
VALUES (sqlc.arg(passhash), sqlc.arg(nickname))
RETURNING id;