Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

chore(alembic-runner): drop stale isolation_level="IMMEDIATE" references (#4039)

LearningCircuit1651587d9ce1
diff --git a/src/local_deep_research/database/alembic_runner.py b/src/local_deep_research/database/alembic_runner.py
index 32bf081def..ee5978d2b1 100644
--- a/src/local_deep_research/database/alembic_runner.py
+++ b/src/local_deep_research/database/alembic_runner.py
@@ -307,8 +307,10 @@ def run_migrations(engine: Engine, target: str = "head") -> None:
When ``target == "head"`` and the database is already at head, the call
short-circuits without opening a write transaction — calling
- ``command.upgrade()`` unconditionally would take a RESERVED lock under
- SQLCipher's ``isolation_level="IMMEDIATE"`` for no work.
+ ``command.upgrade()`` unconditionally would still open a write transaction
+ via ``engine.begin()`` (taking a RESERVED lock on the SQLite file) just to
+ discover there's nothing to apply, serialising concurrent readers behind
+ a no-op on every cold engine reopen.
Security validations performed before running migrations:
- Migration directory path is within expected package boundary
@@ -404,10 +406,10 @@ def run_migrations(engine: Engine, target: str = "head") -> None:
# Short-circuit when the database is already at head. Calling
# command.upgrade() unconditionally opens a write transaction via
- # engine.begin() even when there is nothing to apply — with
- # isolation_level="IMMEDIATE" on SQLCipher engines that means a
- # RESERVED lock on every cold engine reopen, serialising concurrent
- # readers behind a no-op. The fresh-DB path (current is None) still
+ # engine.begin() even when there is nothing to apply — SQLite takes
+ # a RESERVED lock on the file as soon as the first DML lands inside
+ # that transaction, serialising concurrent readers behind a no-op on
+ # every cold engine reopen. The fresh-DB path (current is None) still
# runs the upgrade so tables and the alembic_version row get created.
if current is not None and current == head and target == "head":
logger.info(f"Database already at revision {head}; skipping upgrade")