diff options
author | knotteye <knotteye@airmail.cc> | 2021-07-02 15:10:49 -0500 |
---|---|---|
committer | knotteye <knotteye@airmail.cc> | 2021-07-02 15:10:49 -0500 |
commit | fab8de7187571a4f3f8a30966057d661a858b645 (patch) | |
tree | d050426e46e47c6d4e4e8951dcd5bf914e919fc8 /database.go | |
parent | faae38726dd804e3246514d88f93794c23a0cdb2 (diff) |
add deletion of news items
Diffstat (limited to 'database.go')
-rw-r--r-- | database.go | 5 |
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)` |