-- name: CreateHeartbeat :one
INSERT INTO heartbeat
    ("user", created_at, ip_addr, auth_token)
VALUES (?, ?, ?, ?)
RETURNING *;

-- name: FindHeartbeatByID :one
SELECT *
FROM heartbeat
WHERE id = ?;

-- name: FindHeartbeatByUser :many
SELECT *
FROM heartbeat
WHERE "user" = ?
ORDER BY created_at DESC;