my.twitter.twint: use dict row factory instead of sqlite Row

otherwise it's not json serializable
This commit is contained in:
Dima Gerasimov 2023-03-16 01:31:58 +00:00 committed by karlicoss
parent 79eeab2128
commit 9db5f318fb

View file

@ -109,13 +109,13 @@ ORDER BY T.created_at
def tweets() -> Iterator[Res[Tweet]]:
with sqlite_connection(get_db_path(), immutable=True, row_factory='row') as db:
with sqlite_connection(get_db_path(), immutable=True, row_factory='dict') as db:
res = db.execute(_QUERY.format(where='F.tweet_id IS NULL'))
yield from map(Tweet, res)
def likes() -> Iterator[Res[Tweet]]:
with sqlite_connection(get_db_path(), immutable=True, row_factory='row') as db:
with sqlite_connection(get_db_path(), immutable=True, row_factory='dict') as db:
res = db.execute(_QUERY.format(where='F.tweet_id IS NOT NULL'))
yield from map(Tweet, res)