Commit Graph

19 Commits (f0b479097a4868d74e83c938131f5a24d25c49e8)

Author SHA1 Message Date
Jack Christensen 3dec184811 Split ValidateConnect from AfterConnect
This avoids the foot-gun of ParseConfig setting AfterConnect because of
target_session_attrs and the user inadvertently overriding it with an
AfterConnect designed to setup the connection.

Now target_session_attrs will be handled with ValidateConnect.
2019-07-13 10:22:09 -05:00
Jack Christensen 59941377c8 Rename Config.AfterConnectFunc to AfterConnect
No need to include the type in the name.
2019-07-13 09:52:22 -05:00
Jack Christensen d2440c7fe6 Improve documentation 2019-06-22 16:54:10 -05:00
Jack Christensen cd629965e6 Use golang.org/x/xerrors 2019-04-20 12:57:52 -05:00
Jack Christensen 444bd6deaf Context cancellation is fatal during query 2019-03-30 16:44:20 -05:00
Jack Christensen fbdfccf1f9 Use Go modules 2019-03-30 12:55:56 -05:00
Jack Christensen cd4b0025c3 Add listen/notify to pgconn 2019-01-14 20:39:10 -06:00
Jack Christensen bd777fe20c Add custom context cancellation hook 2019-01-12 11:37:13 -06:00
Jack Christensen 406e95650a Add more docs 2019-01-05 18:40:33 -06:00
Jack Christensen 2c8971b382 Rename some types and methods 2019-01-05 18:01:57 -06:00
Jack Christensen cddf011806 Big restructure to better handle context cancel 2019-01-05 17:37:28 -06:00
Jack Christensen 460946d662 Move notice handling to pgconn 2019-01-02 13:15:26 -06:00
Jack Christensen 4ee6fef452 Add context to potentially blocking methods 2018-12-31 17:17:11 -06:00
Jack Christensen 4e12c08b04 Use buffered exec 2018-12-31 14:14:40 -06:00
Jack Christensen b419493e5c Add pgconn.Exec 2018-12-31 13:32:26 -06:00
Jack Christensen 8c574c39f8 Add support for libpq target_session_attrs
Generalize AcceptConnFunc into AfterConnectFunc.
2018-12-31 12:15:29 -06:00
Jack Christensen 5ae6310b05 Add AcceptConnFunc for filtering HA connections 2018-12-31 11:39:22 -06:00
Jack Christensen 1836f7be46 Support comma separated hosts and ports like libpq
Also add test and fix the fallback config implementation.
2018-12-31 11:14:13 -06:00
Jack Christensen beeb69ff0b Restructure connect process
- Moved lots of connection logic to pgconn from pgx
- Extracted pgpassfile package
2018-12-30 16:55:56 -06:00