aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/db/articles.sql.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/db/articles.sql.go')
-rw-r--r--backend/db/articles.sql.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/backend/db/articles.sql.go b/backend/db/articles.sql.go
index bf6ea1d..7f6400b 100644
--- a/backend/db/articles.sql.go
+++ b/backend/db/articles.sql.go
@@ -28,6 +28,20 @@ func (q *Queries) CheckArticleExists(ctx context.Context, arg CheckArticleExists
return article_exists, err
}
+const checkArticleExistsByGUID = `-- name: CheckArticleExistsByGUID :one
+SELECT EXISTS(
+ SELECT 1 FROM articles
+ WHERE guid = ?
+) as article_exists
+`
+
+func (q *Queries) CheckArticleExistsByGUID(ctx context.Context, guid string) (int64, error) {
+ row := q.db.QueryRowContext(ctx, checkArticleExistsByGUID, guid)
+ var article_exists int64
+ err := row.Scan(&article_exists)
+ return article_exists, err
+}
+
const createArticle = `-- name: CreateArticle :one
INSERT INTO articles (feed_id, guid, title, url, is_read)
VALUES (?, ?, ?, ?, ?)