[stdlib] Add support for creating a DB from pgx.Pool
Also the configuration used in the Conn structure (used to implement the driver.Conn interface) stores a ConnConfig which is used only for determining if the Connection should be used with Simple Protocol or not.
This commit is contained in:
@@ -16,5 +16,12 @@ func openDB(t *testing.T) *sql.DB {
|
||||
t.Fatalf("pgx.ParseConnectionString failed: %v", err)
|
||||
}
|
||||
|
||||
return stdlib.OpenDB(config)
|
||||
pool, err := pgx.NewConnPool(pgx.ConnPoolConfig{
|
||||
ConnConfig: config,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("pgx.ParseConnectionString failed: %v", err)
|
||||
}
|
||||
return stdlib.OpenDBFromPool(pool)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user