Migrate to PostgreSQL #39

Merged
Miroslavsckaya merged 16 commits from migrate_to_postgresql into master 2022-07-13 22:53:54 +00:00
Showing only changes of commit 292a7a3c88 - Show all commits

View file

@ -150,7 +150,7 @@ class Database:
"""Replace last feed items with a list items that receive."""
self.log.debug('update_feed_items(feed_id=\'%s\', new_items=list(%d))', feed_id, len(new_items))
for i, _ in enumerate(new_items):
new_items[i] = [feed_id] + [new_items[i].url, new_items[i].guid]
new_items[i] = [feed_id, new_items[i].url, new_items[i].guid]
self.cur.execute('DELETE FROM feeds_last_items WHERE feed_id = %s', [feed_id])
self.cur.executemany(
'INSERT INTO feeds_last_items (feed_id, url, guid) VALUES (%s, %s, %s)', new_items)