mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +00:00
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:
parent
f7d3c4e151
commit
73471ea3fe
@ -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…
x
Reference in New Issue
Block a user