skeleton/internal/database/sql/queries/user.sql

19 lines
345 B
MySQL
Raw Normal View History

2020-07-19 14:08:18 +02:00
-- 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;