addFeedItem: writer.prepare('insert into feed_items (id, feed_id, guid, title, link, pub_date, content) values (?, ?, ?, ?, ?, ?, ?)'),
getFeedsFor: reader.prepare('select id, feed_id, guid, title, link, pub_date,read_at from feed_items where feed_id = ? and pub_date > ? order by pub_date desc'),
readItem: writer.prepare('update feed_items set read_at = ? where id = ? and read_at = 0'),
- getUnreadCountForAll: reader.prepare('select count(id) as unread, feed_id from feed_items where read_at = 0 group by feed_id')
+ getUnreadCountForAll: reader.prepare('select count(id) as unread, feed_id from feed_items where read_at = 0 group by feed_id'),
+ readAllItems: writer.prepare(`update feed_items set read_at = datetime('now') where feed_id = ?`),
+ _deleteFeedItems: writer.prepare(`delete from feed_items where feed_id = ?`),
+ _deleteFeed: writer.prepare(`delete from feedlist where id = ?`),
+ deleteFeed: {
+ run: (feed_id: string) => {
+ query._deleteFeedItems.run(feed_id);
+ query._deleteFeed.run(feed_id)
+ }
+ }
};