aboutsummaryrefslogtreecommitdiff
path: root/database.go
diff options
context:
space:
mode:
authorknotteye <knotteye@airmail.cc>2021-07-02 15:10:49 -0500
committerknotteye <knotteye@airmail.cc>2021-07-02 15:10:49 -0500
commitfab8de7187571a4f3f8a30966057d661a858b645 (patch)
treed050426e46e47c6d4e4e8951dcd5bf914e919fc8 /database.go
parentfaae38726dd804e3246514d88f93794c23a0cdb2 (diff)
add deletion of news items
Diffstat (limited to 'database.go')
-rw-r--r--database.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/database.go b/database.go
index 731f160..6a871ba 100644
--- a/database.go
+++ b/database.go
@@ -1547,6 +1547,11 @@ func getNewsItemFromDB(db *sql.DB, timestamp int) (NewsItem, error) {
return news, nil
}
+func deleteNewsItemFromDB(db *sql.DB, timestamp int) {
+ query := `delete from newsItem where time=$1`
+ db.Exec(query, timestamp)
+}
+
func WriteNewsToDB(db *sql.DB, news NewsItem) {
query := `insert into newsItem (title, content, time) values ($1, $2, $3)`