23 Commits

Author SHA1 Message Date
Jack Christensen
ac2918b9a3 Add BeginFunc and BeginTxFunc
fixes #821
2021-02-20 18:30:18 -06:00
Jack Christensen
373bb84e9d Add *pgxpool.AcquireFunc
refs #821
2021-02-20 17:16:33 -06:00
Robert Froehlich
210a217818 Add BeforeConnect callback to pgxpool.Config.
This allows for connection settings to be updated without having to create
a new pool. The callback is passed a copy of the pgx.ConnConfig and will
not impact existing live connections.
2021-01-02 15:08:59 -08:00
Jack Christensen
39b096d01e pgxpool waits for connection cleanup to finish before making room in pool
refs #679
2020-08-20 22:04:56 -05:00
georgysavva
e29ce9f6d6 Add Config.Copy() in pgx and pgxpool packages. Conn.Config() and Pool.Config() return copy of the original config. 2020-06-02 13:35:05 +03:00
Jack Christensen
9e1a67c1bc Wait longer in timing sensitive test
Less likely to fail on CI.
2020-05-25 12:04:01 -05:00
Jack Christensen
ac6c49c39d Require access to ConnString via Config
A Config object may be created via ParseConfig and then further
modified. Requiring access to the original ConnString via the Config
helps indicate that the Config is the source of truth as to how the
connection was actually established.
2020-05-16 18:12:04 -05:00
georgysavva
20c6c44f9f Expose Conn.Config() and Pool.Config(). 2020-05-16 19:53:08 +03:00
georgysavva
33cbec368f rename ConnStr -> ConnString 2020-05-16 19:24:57 +03:00
georgysavva
a62de87342 Add ConnStr getter to Pool and Conn structs. 2020-05-16 18:10:29 +03:00
Jack Christensen
f18351f61c Use ++ instead of += 1 2020-05-07 22:28:46 -05:00
Jean-Baptiste Bronisz
4127eba03f
[pgxpool] Fix connection leak if BeginTx() fail 2020-04-07 22:31:09 +02:00
georgysavva
5d453485a9 Introduce new pool setting: LazyConnect 2020-04-03 10:28:05 +03:00
Jack Christensen
f76d37a387 Do not run timing sensitive test in parallel
This test
2020-04-02 22:24:09 -05:00
Jack Christensen
8c9d1cc15b Add test case for #677 2020-02-07 16:07:43 -06:00
Patrick Ellul
a01827732f Implements MinConns, the minimum size of the connection pool.
The health check will increase the number of connections to this amount if it had dropped below.
2020-02-04 08:17:53 +11:00
Patrick Ellul
5082e30c4c Implement maximum connection idle time (MaxConnIdleTime) for pgxpool.
If a connection has been idle for longer than maxConnIdleTime, the health check will destroy it.
2020-01-28 16:36:34 +11:00
Adam Pantel
167442e66b Add a couple error checks 2019-11-22 11:51:58 -05:00
Jack Christensen
93a2aa5b2f Releasing a busy connection closes the connection
refs #622
2019-10-12 11:26:51 -05:00
Jack Christensen
f20f026b7d Pool BeforeAcquire hook takes context 2019-08-31 08:57:03 -05:00
Jack Christensen
ddd9cf451e Update pgxpool for latest pgconn 2019-08-27 18:29:14 -05:00
Jack Christensen
b7b52ff079 Require conn and pool configs to be created by ParseConfig
This simplifies handling default values. Now there is no ambiguity
between a zero value and a default value. All default values are set by
ParseConfig and the user can modify them after the initial creation.

fixes #567
2019-08-24 09:53:38 -05:00
Jack Christensen
08b412740f Rename package pool to pgxpool
pool is too common a name to occupy.
2019-06-29 11:37:36 -05:00