home · contact · privacy
Ensure DbConn encapsulates its executions into rollbackable transactions.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 2 Dec 2024 11:12:04 +0000 (12:12 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 2 Dec 2024 11:12:04 +0000 (12:12 +0100)
src/ytplom/misc.py

index 805f22f15c65ccdf715b0a4d16e01546a6040192..4c26b4bf5edc5fd391182851b037bcd74d18b718 100644 (file)
@@ -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