stdlib/GetPoolConnector: Before/AfterAcquire
zekth opened this issue · comments
Vìncent Le Goff commented
In this commit: 1885648
this was removed:
func OptionBeforeAcquire(ba func(context.Context, *pgxpool.Pool) error) OptionOpenDB {
return func(c *connector) {
c.BeforeAcquire = ba
}
}
// OptionAfterAcquire provides a callback for after acquire. Used only if db is opened with *pgxpool.Pool.
func OptionAfterAcquire(aa func(context.Context, *pgxpool.Conn) error) OptionOpenDB {
return func(c *connector) {
c.AfterAcquire = aa
}
}
What's the rational for it? Is there hopes to have this back?
Would it be possible to have also AfterRelease
?
Lev Zakharov commented
You can set this callbacks right inside your pgxpool.Pool
. See BeforeAcquire
and AfterRelease
in pgxpool.Config.
Vìncent Le Goff commented
Ok my bad i thought it was removed seeing the commits. Thanks