19 lines
345 B
MySQL
19 lines
345 B
MySQL
|
-- 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;
|