()
| 44 | |
| 45 | @contextmanager |
| 46 | def get_db() -> Generator[sqlite3.Connection, None, None]: |
| 47 | conn = _get_connection() |
| 48 | try: |
| 49 | yield conn |
| 50 | conn.commit() |
| 51 | except Exception: |
| 52 | conn.rollback() |
| 53 | raise |
| 54 | |
| 55 | |
| 56 | def init_db() -> None: |
no test coverage detected