mirror of https://github.com/jackc/pgx.git
Use pgx.ParseConnectionString in test helper
This allows using URI or DSN for database connection information. DSN allows using unix domain sockets.non-blocking
parent
851479b0d3
commit
fa68e44e5f
|
@ -35,7 +35,7 @@ func MustConnectDatabaseSQL(t testing.TB, driverName string) *sql.DB {
|
||||||
}
|
}
|
||||||
|
|
||||||
func MustConnectPgx(t testing.TB) *pgx.Conn {
|
func MustConnectPgx(t testing.TB) *pgx.Conn {
|
||||||
config, err := pgx.ParseURI(os.Getenv("PGX_TEST_DATABASE"))
|
config, err := pgx.ParseConnectionString(os.Getenv("PGX_TEST_DATABASE"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue