Use pgx.ParseConnectionString in test helper
This allows using URI or DSN for database connection information. DSN allows using unix domain sockets.
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user