2
0

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:
Rick Snyder
2015-08-18 16:00:37 -04:00
parent db5300358a
commit 6413491657
3 changed files with 120 additions and 7 deletions
+3 -2
View File
@@ -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