X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=plomtask%2Fdb.py;h=01bc3e940767eafcd7a3e728a5d73caf7b04aa79;hb=6b329a28bb4aec8d1846f5cc5402ed6fca5eb3da;hp=e0a5d4f5df5426512c8a7552ca889c598dcaabfe;hpb=3558a14701955de18ae7adbda0e93aaee7710a92;p=plomtask diff --git a/plomtask/db.py b/plomtask/db.py index e0a5d4f..01bc3e9 100644 --- a/plomtask/db.py +++ b/plomtask/db.py @@ -2,8 +2,8 @@ from os.path import isfile from difflib import Differ from sqlite3 import connect as sql_connect, Cursor -from typing import Any -from plomtask.misc import HandledException +from typing import Any, Dict +from plomtask.exceptions import HandledException PATH_DB_SCHEMA = 'scripts/init.sql' @@ -49,6 +49,10 @@ class DatabaseConnection: def __init__(self, db_file: DatabaseFile) -> None: self.file = db_file self.conn = sql_connect(self.file.path) + self.cached_todos: Dict[int, Any] = {} + self.cached_days: Dict[str, Any] = {} + self.cached_process_steps: Dict[int, Any] = {} + self.cached_processes: Dict[int, Any] = {} def commit(self) -> None: """Commit SQL transaction."""