diff --git a/src/smarttools/registry/db.py b/src/smarttools/registry/db.py index 1a1ace5..71956d7 100644 --- a/src/smarttools/registry/db.py +++ b/src/smarttools/registry/db.py @@ -245,7 +245,13 @@ def connect_db(path: Path | None = None) -> sqlite3.Connection: ensure_db_directory(db_path) conn = sqlite3.connect(db_path) conn.row_factory = sqlite3.Row - conn.execute("PRAGMA journal_mode=WAL;") + # WAL mode provides better concurrency but may not work on all filesystems + # (e.g., some FUSE filesystems like mergerfs). Fall back gracefully. + try: + conn.execute("PRAGMA journal_mode=WAL;") + except sqlite3.OperationalError: + # Fall back to DELETE journal mode which works everywhere + conn.execute("PRAGMA journal_mode=DELETE;") conn.execute("PRAGMA foreign_keys=ON;") return conn