Skip to content

Commit d93f31b

Browse files
zekthjackc
authored andcommitted
docs: GetPoolConnector
1 parent cf72a00 commit d93f31b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/sql.go

+4
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ func GetConnector(config pgx.ConnConfig, opts ...OptionOpenDB) driver.Connector
204204
return c
205205
}
206206

207+
// GetPoolConnector creates a new driver.Connector from the given *pgxpool.Pool. By using this be sure to set the
208+
// maximum idle connections of the *sql.DB created with this connector to zero since they must be managed from the
209+
// *pgxpool.Pool. This is required to avoid acquiring all the connections from the pgxpool and starving any direct
210+
// users of the pgxpool.
207211
func GetPoolConnector(pool *pgxpool.Pool, opts ...OptionOpenDB) driver.Connector {
208212
c := connector{
209213
pool: pool,

0 commit comments

Comments
 (0)