From: Christian Heller Date: Mon, 2 Dec 2024 11:12:04 +0000 (+0100) Subject: Ensure DbConn encapsulates its executions into rollbackable transactions. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7Bdb.prefix%7D%7D/add_task?a=commitdiff_plain;ds=sidebyside;p=ytplom Ensure DbConn encapsulates its executions into rollbackable transactions. --- diff --git a/src/ytplom/misc.py b/src/ytplom/misc.py index 805f22f..4c26b4b 100644 --- a/src/ytplom/misc.py +++ b/src/ytplom/misc.py @@ -152,7 +152,7 @@ class DbConn: raise HandledException( f'wrong database version {cur_version}, expected: ' f'{EXPECTED_DB_VERSION} – run "migrate"?') - self._conn = sql_connect(self._path) + self._conn = sql_connect(self._path, autocommit=False) def __enter__(self) -> Self: return self