Merge pull request #473 from Mic92/unix-sockets
Add path query parameter to support unix sockets
This commit is contained in:
@@ -774,6 +774,11 @@ func ParseURI(uri string) (ConnConfig, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if k == "host" {
|
||||||
|
cp.Host = v[0]
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
cp.RuntimeParams[k] = v[0]
|
cp.RuntimeParams[k] = v[0]
|
||||||
}
|
}
|
||||||
if cp.Password == "" {
|
if cp.Password == "" {
|
||||||
|
|||||||
@@ -458,6 +458,19 @@ func TestParseURI(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
url: "postgres:///foo?host=/tmp",
|
||||||
|
connParams: pgx.ConnConfig{
|
||||||
|
Host: "/tmp",
|
||||||
|
Database: "foo",
|
||||||
|
TLSConfig: &tls.Config{
|
||||||
|
InsecureSkipVerify: true,
|
||||||
|
},
|
||||||
|
UseFallbackTLS: true,
|
||||||
|
FallbackTLSConfig: nil,
|
||||||
|
RuntimeParams: map[string]string{},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for i, tt := range tests {
|
for i, tt := range tests {
|
||||||
|
|||||||
Reference in New Issue
Block a user