(self)
| 123 | return self._store()._conn |
| 124 | |
| 125 | def _store(self) -> Store: |
| 126 | if self._closed: |
| 127 | raise RuntimeError("CachingStore is closed") |
| 128 | |
| 129 | thread_store = getattr(self._local, "store", None) |
| 130 | if thread_store is not None: |
| 131 | return thread_store |
| 132 | |
| 133 | with self._stores_lock: |
| 134 | if self._closed: |
| 135 | raise RuntimeError("CachingStore is closed") |
| 136 | |
| 137 | thread_store = Store(self._db_path, read_only=True) |
| 138 | self._local.store = thread_store |
| 139 | self._stores.append(thread_store) |
| 140 | return thread_store |
| 141 | |
| 142 | @classmethod |
| 143 | def create(cls, db_path: str) -> NoReturn: |
no test coverage detected