19 lines
No EOL
345 B
SQL
19 lines
No EOL
345 B
SQL
-- name: GetUserByID :one
|
|
SELECT
|
|
"id", "is_admin", "password", "created_at"
|
|
FROM "user"
|
|
WHERE "id" = $1;
|
|
|
|
-- name: CreateUser :one
|
|
INSERT INTO "user" (
|
|
"is_admin", "password", "created_at"
|
|
) VALUES (
|
|
$1, $2, $3
|
|
) RETURNING *;
|
|
|
|
-- name: UpdateUser :exec
|
|
UPDATE "user" SET (
|
|
"is_admin", "password", "created_at"
|
|
) = (
|
|
$1, $2, $3
|
|
) WHERE "id" = $4; |