Add support for specifying sslmode in connection strings
Add tests for sslmode parameter when calling ParseURI. Fix existing tests to work since default sslmode is 'prefer' Make sure we default to prefer if sslmode is not provided in ParseDSN Fix existing tests for ParseDSN to expect TLS configuration for prefer since prefer is the default sslmode; also, add tests for ParseDSN when specifying sslmode parameter on connection string
This commit is contained in:
+3
-2
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// A database/sql connection can be established through sql.Open.
|
||||
//
|
||||
// db, err := sql.Open("pgx", "postgres://pgx_md5:secret@localhost:5432/pgx_test")
|
||||
// db, err := sql.Open("pgx", "postgres://pgx_md5:secret@localhost:5432/pgx_test?sslmode=disable")
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
@@ -48,8 +48,9 @@ import (
|
||||
"database/sql/driver"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/jackc/pgx"
|
||||
"io"
|
||||
|
||||
"github.com/jackc/pgx"
|
||||
)
|
||||
|
||||
var openFromConnPoolCount int
|
||||
|
||||
Reference in New Issue
Block a user