()
| 17 | |
| 18 | |
| 19 | def connect() -> sqlite3.Connection: |
| 20 | path = db_path() |
| 21 | path.parent.mkdir(parents=True, exist_ok=True) |
| 22 | conn = sqlite3.connect(path) |
| 23 | conn.row_factory = sqlite3.Row |
| 24 | conn.execute("PRAGMA foreign_keys = ON") |
| 25 | conn.execute("PRAGMA journal_mode = WAL") |
| 26 | conn.execute("PRAGMA busy_timeout = 5000") |
| 27 | return conn |
| 28 | |
| 29 | |
| 30 | def init_db() -> None: |
no test coverage detected