-- name: GetVote :one
SELECT value
FROM votes
WHERE user_id = $1 AND question_id = $2;

-- name: DeleteVote :exec
DELETE FROM votes
WHERE user_id = $1 AND question_id = $2;

-- name: UpsertVote :exec
INSERT INTO votes (user_id, question_id, value)
VALUES ($1, $2, $3)
ON CONFLICT (user_id, question_id) DO UPDATE
SET value = excluded.value;
