Skip to content

Commit

Permalink
Remove the autocommit argument to sqlite3.connect()
Browse files Browse the repository at this point in the history
  • Loading branch information
kgodlewski committed Jan 9, 2025
1 parent 9f14a62 commit b6db3a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/neptune_scale/storage/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def init_db(self) -> None:

# We use `check_same_thread=False` because closing the DB could be called from different
# threads. It's fine, as long as we do our own synchronization.
self._db = sqlite3.connect(self._db_path, autocommit=False, check_same_thread=False)
self._db = sqlite3.connect(self._db_path, check_same_thread=False)
if self._resume:
self._last_synced_op = self._db.execute(
"SELECT last_synced_operation FROM meta WHERE run_id = ?", (self._run_id,)
Expand Down Expand Up @@ -151,7 +151,7 @@ def __init__(self, db_path: Union[str, Path]) -> None:
if not os.path.isfile(db_path):
raise FileNotFoundError(f"Database not found at {db_path}")

self._db = sqlite3.connect(db_path, autocommit=False, check_same_thread=False)
self._db = sqlite3.connect(db_path, check_same_thread=False)
self.run = LocalRun.from_db(self._db, Path(db_path))

@property
Expand Down

0 comments on commit b6db3a1

Please sign in to comment.