mirror of https://github.com/jackc/pgx.git
Merge pull request #473 from Mic92/unix-sockets
Add path query parameter to support unix socketspull/479/head
commit
c10ee2b7bf
5
conn.go
5
conn.go
|
@ -774,6 +774,11 @@ func ParseURI(uri string) (ConnConfig, error) {
|
|||
continue
|
||||
}
|
||||
|
||||
if k == "host" {
|
||||
cp.Host = v[0]
|
||||
continue
|
||||
}
|
||||
|
||||
cp.RuntimeParams[k] = v[0]
|
||||
}
|
||||
if cp.Password == "" {
|
||||
|
|
13
conn_test.go
13
conn_test.go
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue