(value: str | Path)
| 42 | |
| 43 | |
| 44 | def normalize_sqlite_url(value: str | Path) -> str: |
| 45 | raw = str(value or "").strip() |
| 46 | if not raw: |
| 47 | raise MigrationError("SQLite 源路径不能为空") |
| 48 | if raw.startswith("sqlite:///"): |
| 49 | return raw |
| 50 | if "://" in raw: |
| 51 | raise MigrationError("源库必须是 SQLite 文件路径或 sqlite:/// URL") |
| 52 | return f"sqlite:///{raw}" |
| 53 | |
| 54 | |
| 55 | def normalize_postgres_url(value: str) -> str: |
no test coverage detected