-- name: CreateHeartbeat :one
INSERT INTO "heartbeat"
    ("user", created_at, ip_addr, auth_token)
VALUES ($1, $2, $3, $4)
RETURNING *;

-- name: FindHeartbeatByID :one
SELECT *
FROM "heartbeat"
WHERE id = $1;

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