Not supported natively by pg8000, so we have to parse ourselves
(conn_string: str)
| 197 | |
| 198 | |
| 199 | def parse_pg_conn_string(conn_string: str) -> PgConnInfo: |
| 200 | """Not supported natively by pg8000, so we have to parse ourselves""" |
| 201 | url = urlparse(conn_string) |
| 202 | query_params = parse_qs(url.query) |
| 203 | assert url.username |
| 204 | assert url.hostname |
| 205 | return PgConnInfo( |
| 206 | user=unquote(url.username), |
| 207 | password=unquote(url.password) if url.password else url.password, |
| 208 | host=url.hostname, |
| 209 | port=url.port or 5432, |
| 210 | database=url.path.lstrip("/"), |
| 211 | ssl=query_params.get("sslmode", ["disable"])[-1] != "disable", |
| 212 | ) |
| 213 | |
| 214 | |
| 215 | FILTERED_ARGS = [ |
no test coverage detected