twint: open database in read only mode
This commit is contained in:
parent
4920defe12
commit
626ee994bf
2 changed files with 4 additions and 4 deletions
|
@ -123,3 +123,5 @@ def main():
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
# TODO copy a couble of databases (one old, one new) to my public data repository?
|
||||||
|
|
|
@ -91,11 +91,9 @@ ORDER BY T.created_at
|
||||||
'''
|
'''
|
||||||
|
|
||||||
def _get_db():
|
def _get_db():
|
||||||
import dataset # type: ignore
|
from ..core.dataset import connect_readonly
|
||||||
db_path = get_db_path()
|
db_path = get_db_path()
|
||||||
# TODO check that exists?
|
return connect_readonly(db_path)
|
||||||
db = dataset.connect(f'sqlite:///{db_path}')
|
|
||||||
return db
|
|
||||||
|
|
||||||
|
|
||||||
def tweets() -> Iterable[Tweet]:
|
def tweets() -> Iterable[Tweet]:
|
||||||
|
|
Loading…
Add table
Reference in a new issue