File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -337,9 +337,11 @@ enum DatabaseDriverFactory {
337337 private static func resolvePassword( for connection: DatabaseConnection ) -> String {
338338 if connection. usePgpass {
339339 let pgpassHost = connection. additionalFields [ " pgpassOriginalHost " ] ?? connection. host
340+ let pgpassPort = connection. additionalFields [ " pgpassOriginalPort " ]
341+ . flatMap ( Int . init) ?? connection. port
340342 return PgpassReader . resolve (
341343 host: pgpassHost. isEmpty ? " localhost " : pgpassHost,
342- port: connection . port ,
344+ port: pgpassPort ,
343345 database: connection. database,
344346 username: connection. username
345347 ) ?? " "
Original file line number Diff line number Diff line change @@ -443,6 +443,7 @@ final class DatabaseManager {
443443 var effectiveFields = connection. additionalFields
444444 if connection. usePgpass {
445445 effectiveFields [ " pgpassOriginalHost " ] = connection. host
446+ effectiveFields [ " pgpassOriginalPort " ] = String ( connection. port)
446447 }
447448
448449 return DatabaseConnection (
You can’t perform that action at this time.
0 commit comments