Skip to content

Fix DatabaseUri() for unix socket paths#170

Merged
jeremydmiller merged 1 commit intomainfrom
fix-unix-socket-database-uri
Mar 25, 2026
Merged

Fix DatabaseUri() for unix socket paths#170
jeremydmiller merged 1 commit intomainfrom
fix-unix-socket-database-uri

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

  • Sanitize server names in DatabaseDescriptor.DatabaseUri() by replacing / and : with _ before URI construction
  • Unix socket paths (e.g. /cloudsql/platform-dev:europe-west4:shared-db) contain characters invalid in URI hostnames, causing UriFormatException
  • Add tests for unix socket paths, multi-host pipelines, and standard hostnames

Closes JasperFx/marten#4204

Test plan

  • New test: unix socket path (/cloudsql/platform-dev:europe-west4:shared-db) produces valid URI
  • New test: multi-host pipeline (host1,host2,host3) uses first host
  • New test: multi-host pipeline with schema
  • Existing tests still pass (standard hostname, serialization)

🤖 Generated with Claude Code

Sanitize server names containing forward slashes and colons (common in
unix socket paths like /cloudsql/platform-dev:europe-west4:shared-db)
by replacing them with underscores before constructing the URI. This
prevents UriFormatException when the server name contains characters
invalid in URI hostnames.

Closes JasperFx/marten#4204

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit 4745c3b into main Mar 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support unix sockets

1 participant