feat: add support for creating users and chirps
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
-- name: CreateChirp :one
|
||||
INSERT INTO chirps (id, created_at, updated_at, body, user_id)
|
||||
VALUES (
|
||||
gen_random_uuid(),
|
||||
NOW(),
|
||||
NOW(),
|
||||
$1,
|
||||
$2
|
||||
)
|
||||
RETURNING *;
|
||||
@@ -0,0 +1,17 @@
|
||||
-- name: CreateUser :one
|
||||
INSERT INTO users (id, created_at, updated_at, email)
|
||||
VALUES (
|
||||
gen_random_uuid(),
|
||||
NOW(),
|
||||
NOW(),
|
||||
$1
|
||||
)
|
||||
RETURNING *;
|
||||
|
||||
|
||||
-- name: DeleteAllUsers :exec
|
||||
DELETE FROM users;
|
||||
|
||||
-- name: GetUserById :one
|
||||
SELECT id, created_at, updated_at, email FROM users
|
||||
WHERE id = $1;
|
||||
Reference in New Issue
Block a user