-- name: SelectKey :one
SELECT * FROM "key" WHERE id=$1 LIMIT 1;

-- name: SelectKeys :many
SELECT * FROM "key";

-- name: SelectKeysByUser :many
SELECT * FROM "key" WHERE "user" = $1;

-- name: InsertKey :exec
INSERT INTO key (id, name, "user", secret)
VALUES (@id, @name, @user_id, @secret);

-- name: DeleteKey :exec
DELETE FROM "key" WHERE id = $1;