twint: open database in read only mode

This commit is contained in:
Dima Gerasimov 2020-07-28 20:33:39 +01:00 committed by karlicoss
parent 4920defe12
commit 626ee994bf
2 changed files with 4 additions and 4 deletions

View file

@ -123,3 +123,5 @@ def main():
if __name__ == '__main__':
main()
# TODO copy a couble of databases (one old, one new) to my public data repository?

View file

@ -91,11 +91,9 @@ ORDER BY T.created_at
'''
def _get_db():
import dataset # type: ignore
from ..core.dataset import connect_readonly
db_path = get_db_path()
# TODO check that exists?
db = dataset.connect(f'sqlite:///{db_path}')
return db
return connect_readonly(db_path)
def tweets() -> Iterable[Tweet]: