MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / normalize_sqlite_url

Function normalize_sqlite_url

scripts/migrate_sqlite_to_postgres.py:44–52  ·  view source on GitHub ↗
(value: str | Path)

Source from the content-addressed store, hash-verified

42
43
44def 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
55def normalize_postgres_url(value: str) -> str:

Callers 1

Calls 1

MigrationErrorClass · 0.85

Tested by

no test coverage detected