-- name: CreateEntryWithKindName :one
INSERT INTO entries (title, kind, url, description) 
SELECT ?, kinds.id, ?, ?
FROM kinds
WHERE kinds.name = ?
RETURNING *;

-- name: GetEntries :many
SELECT title, url, description, timestamp, kinds.name as kind_name, kinds.emoji as kind_emoji FROM entries
JOIN kinds ON entries.kind == kinds.id
ORDER BY timestamp DESC;
