1484 Commits

Author SHA1 Message Date
Jack Christensen
0330052b0a Use result readers in next/get fashion 2019-01-01 14:10:16 -06:00
Jack Christensen
b12b579814 Remove another allocation 2019-01-01 13:56:09 -06:00
Jack Christensen
c067c970cf Remove another allocation 2019-01-01 13:52:04 -06:00
Jack Christensen
d31f38affb Add pgconn stress test 2019-01-01 13:49:12 -06:00
Jack Christensen
356a6c43d2 Avoid allocating strings in common message types 2019-01-01 13:47:37 -06:00
Jack Christensen
4f0658d52b Extract bufferLastResult
Buffered exec methods need to read until pending ready for queries is 0.
Factor this common logic out.

Add stress test for PgConn.
2019-01-01 13:16:50 -06:00
Jack Christensen
e78cefecc5 Format code constants already in pgproto3 2019-01-01 11:35:39 -06:00
Jack Christensen
b537f2c412 Add ExecPrepared 2019-01-01 11:32:56 -06:00
Jack Christensen
421cfd5547 Add batched query test 2018-12-31 20:08:11 -06:00
Jack Christensen
6ac70533bf Added ExecParams 2018-12-31 19:59:32 -06:00
Jack Christensen
8d2e1463ed Fix broken tests 2018-12-31 18:45:51 -06:00
Jack Christensen
be7a7b44dc Access PID and SecretKey via method 2018-12-31 18:03:55 -06:00
Jack Christensen
1ff8024df9 Access underlying net.Conn via method
Also remove some dead code.
2018-12-31 18:00:08 -06:00
Jack Christensen
af2fc36c27 Remove code moved to pgconn 2018-12-31 17:52:11 -06:00
Jack Christensen
378ccb8945 PG error type is *pgconn.PgError 2018-12-31 17:46:56 -06:00
Jack Christensen
103ab963eb pgx uses pgconn CancelRequest 2018-12-31 17:37:07 -06:00
Jack Christensen
03f2d34486 Run tests in parallel 2018-12-31 17:34:44 -06:00
Jack Christensen
a8ac061b6a Add cancel request to PgConn
RecoverFromTimeout automatically tries to cancel in progress requests.
2018-12-31 17:32:04 -06:00
Jack Christensen
084423ae69 Add context to potentially blocking methods 2018-12-31 17:17:11 -06:00
Jack Christensen
d229219039 Use buffered exec 2018-12-31 14:14:40 -06:00
Jack Christensen
c33441674f Add pgconn.Exec 2018-12-31 13:32:26 -06:00
Jack Christensen
c552e2c028 Add support for libpq target_session_attrs
Generalize AcceptConnFunc into AfterConnectFunc.
2018-12-31 12:15:29 -06:00
Jack Christensen
28ee40f347 Add AcceptConnFunc for filtering HA connections 2018-12-31 11:39:22 -06:00
Jack Christensen
afd3583558 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
c672c0d595 Use environment variables for test configuration 2018-12-30 21:52:33 -06:00
Jack Christensen
67a15e6f7f Move connection tests to pgconn 2018-12-30 21:10:06 -06:00
Jack Christensen
b3c8a73dc7 Restructure connect process
- Moved lots of connection logic to pgconn from pgx
- Extracted pgpassfile package
2018-12-30 16:55:56 -06:00
Jack Christensen
9990e4894d Rename base package to pgconn 2018-12-28 17:09:56 -06:00
Jack Christensen
b89ba28919 Add beginning of PgConn 2018-12-28 17:06:39 -06:00
Jack Christensen
44de49ffa1 Rename runtime params to parameter status 2018-12-28 12:25:59 -06:00
Jack Christensen
b63370e5d5 Rename base.Conn to base.PgConn
- pgx.Conn embeds base.PgConn privately
- Add pgx.Conn.ParameterStatus
2018-12-28 12:16:50 -06:00
Jack Christensen
5c05f3f2ce Add more todo ideas 2018-12-28 12:06:51 -06:00
Jack Christensen
25f21a597c Merge branch 'nvorobev-rows-affected-for-copyto-copyfrom' into v4-experimental 2018-12-15 17:26:48 -06:00
Jack Christensen
de3869bddd Merge branch 'rows-affected-for-copyto-copyfrom' of https://github.com/nvorobev/pgx into nvorobev-rows-affected-for-copyto-copyfrom 2018-12-15 17:24:03 -06:00
Jack Christensen
b2352a4d37 Merge branch 'master' into v4-experimental 2018-12-15 17:23:12 -06:00
Jack Christensen
4618730e71
Merge pull request #491 from mialinx/master
More precise .pgpass handling
2018-12-15 17:11:13 -06:00
Nikolay Vorobev
a0331e7409 Adds RowsAffected for CopyToWriter and CopyFromReader 2018-12-13 12:54:42 +03:00
Dmitry Smal
af319b2c9a More precise .pgpass handling
* localhost matches unix sockets too
* use OS user as default username
* use username as default database
* ignore comment lines
2018-12-11 11:46:31 +03:00
Jack Christensen
a9a178bc98 Merge branch 'master' into v4-experimental 2018-12-01 11:17:30 -06:00
Jack Christensen
c59c9cac59 Update changelog for v3.3.0 v3.3.0 2018-12-01 11:13:13 -06:00
Jack Christensen
b5fee42f0a
Merge pull request #488 from maxarchx/master
Apply UUID string length check before parsing
2018-12-01 10:39:47 -06:00
Jack Christensen
f25025a580
Merge pull request #486 from yobert/master
Fix two minor grammatical errors in source documentation
2018-12-01 10:38:57 -06:00
Jack Christensen
5ff0ebeec6
Merge pull request #482 from fastest963/retry
Added LastStmtSent and use it to retry on errors if statement was not sent
2018-12-01 10:38:10 -06:00
maxarchx
b1a17cf284 Apply UUID string length check before parsing 2018-11-30 15:13:43 +05:00
Joel Jensen
41b714110a Fix two minor grammatical errors in source documentation 2018-11-27 16:40:46 -07:00
James Hartig
6d336eccb1 Added LastStmtSent and use it to retry on errors if statement was not sent
Previously, a failed connection could be put back in a pool and when the
next query was attempted it would fail immediately trying to prepare the
query or reset the deadline. It wasn't clear if the Query or Exec call
could safely be retried since there was no way to know where it failed.

You can now call LastQuerySent and if it returns false then you're
guaranteed that the last call to Query(Ex)/Exec(Ex) didn't get far enough
to attempt to send the query. The call can be retried with a new
connection.

This is used in the stdlib to return a ErrBadConn if a network error
occurred and the statement was not attempted.

Fixes #427
2018-11-19 10:44:40 -05:00
Jack Christensen
d41376dfbc Error handling ideas 2018-11-17 20:27:20 -06:00
Jack Christensen
21656fbd17 Add context / cancel ideas 2018-11-17 20:24:22 -06:00
Jack Christensen
65e69c5580 Initial base.Connect extraction 2018-11-12 18:08:46 -06:00
Jack Christensen
06fb816b71 Add more notes about v4 2018-11-10 19:44:17 -06:00