From fbe4bff7e8b6a5239c490601436fb3638dc8e13b Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Sat, 12 Jul 2025 17:11:13 +0900
Subject: feat(backend): introduce sqlc

---
 backend/db/queries/feeds.sql | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 backend/db/queries/feeds.sql

(limited to 'backend/db/queries/feeds.sql')

diff --git a/backend/db/queries/feeds.sql b/backend/db/queries/feeds.sql
new file mode 100644
index 0000000..6d4d172
--- /dev/null
+++ b/backend/db/queries/feeds.sql
@@ -0,0 +1,32 @@
+-- name: GetFeed :one
+SELECT id, url, title, fetched_at
+FROM feeds
+WHERE id = ?;
+
+-- name: GetFeeds :many
+SELECT id, url, title, fetched_at
+FROM feeds
+ORDER BY id;
+
+-- name: CreateFeed :one
+INSERT INTO feeds (url, title, fetched_at)
+VALUES (?, ?, ?)
+RETURNING *;
+
+-- name: UpdateFeedMetadata :exec
+UPDATE feeds
+SET title = ?, fetched_at = ?
+WHERE id = ?;
+
+-- name: DeleteFeed :exec
+DELETE FROM feeds
+WHERE id = ?;
+
+-- name: GetFeedByURL :one
+SELECT id, url, title, fetched_at
+FROM feeds
+WHERE url = ?;
+
+-- name: GetFeedsToFetch :many
+SELECT id, url, fetched_at
+FROM feeds;
-- 
cgit v1.2.3-70-g09d2

