Repository navigation
feat(connections): connect PostgreSQL through a local Unix socket - #3721
Merged
Merged
Conversation
…ix-socket # Conflicts: # apple/TablePro/Core/Utilities/Connection/ConnectionURLFormatter.swift # apple/TablePro/Core/Utilities/Connection/ConnectionURLParser.swift
…y ports as libpq does
…ix-socket # Conflicts: # apple/TablePro/Resources/Localizable.xcstrings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.s.PGSQL.<port>file and suggests /tmp and /var/run/postgresql. Port stays visible since it names the socket file. A file path is saved as its folder plus the port from its name.SuggestionComboBox;AWSProfileFieldnow uses it too.hostwithhostaddr='', so an inherited PGHOSTADDR cannot switch it to TCP. A relative path, a comma, a hidden character or a socket file path over 103 bytes fails before libpq dials (PostgreSQLLocalSocket).postgresql://URLs readhost=andport=from the query and a percent-encoded host (%2Ftmp), as libpq does. An empty query port means 5432; an invalid one refuses the URL. Copy Connection String writespostgresql://user@localhost[:port]/db?host=/dir.~/.pgpassmatching follows libpq: /tmp aslocalhost, any other folder by its path, with the socket's port.~/.pgpasslookup now means the macOS login name, as in libpq. It used to match literally.~/.pgpassstatus line updates again; refactor refactor(connection-form): native HIG rebuild + categorized chooser sheet #995 had removed its trigger.-hand-p.NetworkPaneLocalSocketTests,SocketPathPlaceholderTests,DatabaseConnectionLocalSocketTests,ConnectionImportLinkSocketTests,ConnectionURLFormatterTests,ConnectionURLParserSocketTests, and iOSConnectionDetailFormatterTests.Not in this PR
hostaddr.postgresql:///dbwith no host still asks for a host. libpq would use /tmp; left so a templating mistake is not read as a socket.MySQLLocalSocket.fieldKey. Renaming it touches about 35 files across both apps.Test plan
PostgreSQLLocalSocketTests,ConnectionURLPostgreSQLSocketTests,DatabaseConnectionPostgreSQLSocketTests,NetworkPanePostgreSQLSocketTests, plusNativeDumpRegistryTestsand iOSIOSDriverFactoryRefusalTestscases.apple/scripts/probes/check-postgresql-local-socket.shagainst PostgreSQL 17.11 listening only on its socket with peer auth confirms the libpq behavior the code relies on.Fixes #3619