This commit is contained in:
Ansh Rohilla 2026-11-04 01:08:39 +00:00 • committed by GitHub
commit e2e472d327
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View file

@ -93,6 +93,9 @@ class _InvalidIndex:
MAX_MIGRATE_DEPLOY_ATTEMPTS = 4
LIBPQ_URL_PARAMS: Final = frozenset(
{
"host",
"hostaddr",
"port",
"sslmode",
"sslcert",
"sslkey",

View file

@ -71,6 +71,14 @@ def test_strip_prisma_query_params_passthrough_no_query():
assert ProxyExtrasDBManager._strip_prisma_query_params(url) == url
def test_strip_prisma_query_params_preserves_host_socket():
"""Unix-socket DATABASE_URLs using host parameter (e.g. Cloud SQL) must be preserved."""
url = "postgresql://user:pass@localhost/litellm?host=/cloudsql/project:region:instance&connection_limit=10"
stripped = ProxyExtrasDBManager._strip_prisma_query_params(url)
assert "host=%2Fcloudsql%2Fproject%3Aregion%3Ainstance" in stripped
assert "connection_limit" not in stripped
def test_migration_timestamp_extracts_leading_digits():
assert _migration_timestamp("20260101000000_add_foo") == 20260101000000
assert _migration_timestamp("20250326162113_baseline") == 20250326162113