feat: registrationBegin method without email;

fix: missing sqlc query parameter name;
feat: util for generating security codes;
feat: enums package
This commit is contained in:
2025-06-23 16:23:46 +03:00
parent 1b55498b00
commit 0a00a5ee2b
7 changed files with 155 additions and 94 deletions

View File

@@ -94,8 +94,8 @@ WHERE users.username = $1;
--: Confirmation Code Object {{{
;-- name: CreateConfirmationCode :one
INSERT INTO confirmation_codes(user_id, code_type, code_hash, expires_at)
VALUES ($1, $2, crypt($3, gen_salt('bf')), $4) RETURNING *;
INSERT INTO confirmation_codes(user_id, code_type, code_hash)
VALUES ($1, $2, crypt(@code::text, gen_salt('bf'))) RETURNING *;
;-- name: GetConfirmationCodeByCode :one
SELECT * FROM confirmation_codes

View File

@@ -8,7 +8,7 @@ sql:
out: "../backend/internal/database"
sql_package: "pgx/v5"
emit_prepared_queries: true
emit_interface: false
emit_pointers_for_null_types: true
database:
# managed: true
uri: "postgresql://postgres:postgres@localhost:5432/postgres?sslmode=disable"