2024-10-23 22:16:51 +02:00
|
|
|
-- name: CreateUser :one
|
2024-10-25 23:31:57 +02:00
|
|
|
INSERT INTO users (id, created_at, updated_at, email, hashed_password)
|
2024-10-23 22:16:51 +02:00
|
|
|
VALUES (
|
|
|
|
gen_random_uuid(),
|
|
|
|
NOW(),
|
|
|
|
NOW(),
|
2024-10-25 23:31:57 +02:00
|
|
|
$1,
|
|
|
|
$2
|
2024-10-23 22:16:51 +02:00
|
|
|
)
|
|
|
|
RETURNING *;
|
|
|
|
|
|
|
|
-- name: DeleteUser :one
|
|
|
|
DELETE FROM users
|
2024-10-24 22:40:26 +02:00
|
|
|
RETURNING *;
|
|
|
|
|
|
|
|
-- name: GetUserByEmail :one
|
|
|
|
SELECT * FROM users
|
|
|
|
WHERE users.email = $1;
|