From f1741a7faa9538e9b12ac60e0fbf6c7721a36059 Mon Sep 17 00:00:00 2001
From: Leonardo Bishop <me@leonardobishop.net>
Date: Tue, 9 Sep 2025 22:44:09 +0100
Subject: Initial commit

---
 pkg/database/query/entries.sql | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 pkg/database/query/entries.sql

(limited to 'pkg/database/query/entries.sql')

diff --git a/pkg/database/query/entries.sql b/pkg/database/query/entries.sql
new file mode 100644
index 0000000..1927468
--- /dev/null
+++ b/pkg/database/query/entries.sql
@@ -0,0 +1,11 @@
+-- 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.id == kinds.id
+ORDER BY timestamp DESC;
-- 
cgit v1.2.3-70-g09d2

