Parse PostgreSQL URI and extract connection details.
(uri: str)
| 69 | |
| 70 | |
| 71 | def parse_pg_uri(uri: str) -> Dict[str, str]: |
| 72 | """Parse PostgreSQL URI and extract connection details.""" |
| 73 | parsed = urlparse(uri) |
| 74 | return { |
| 75 | "host": parsed.hostname or "localhost", |
| 76 | "port": str(parsed.port or 5432), |
| 77 | "user": parsed.username or "mirix", |
| 78 | "database": parsed.path.lstrip("/") or "mirix", |
| 79 | } |
| 80 | |
| 81 | |
| 82 | def get_pg_connection_details() -> Dict[str, str]: |
no outgoing calls
no test coverage detected