chirpy_server/sql/queries/users.sql

18 lines
310 B
MySQL
Raw Normal View History

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
RETURNING *;
-- name: GetUserByEmail :one
SELECT * FROM users
WHERE users.email = $1;