(self, db_path: Optional[Path] = None)
| 181 | """ |
| 182 | |
| 183 | def __init__(self, db_path: Optional[Path] = None) -> None: |
| 184 | if db_path is None: |
| 185 | db_dir = PROJECT_ROOT / ".openspace" |
| 186 | db_dir.mkdir(parents=True, exist_ok=True) |
| 187 | db_path = db_dir / "openspace.db" |
| 188 | |
| 189 | self._db_path = Path(db_path) |
| 190 | self._mu = threading.Lock() |
| 191 | self._closed = False |
| 192 | |
| 193 | # Crash recovery: clean up stale WAL/SHM from unclean shutdown |
| 194 | self._cleanup_wal_on_startup() |
| 195 | |
| 196 | # Persistent write connection |
| 197 | self._conn = self._make_connection(read_only=False) |
| 198 | self._init_db() |
| 199 | logger.debug(f"SkillStore ready at {self._db_path}") |
| 200 | |
| 201 | def _make_connection(self, *, read_only: bool) -> sqlite3.Connection: |
| 202 | """Create a tuned SQLite connection. |
nothing calls this directly
no test coverage detected