3085 Commits

Author SHA1 Message Date
Jack Christensen
a4375eb53f Add test that Hijack'ed conn is no longer usable. 2020-01-17 17:42:20 -06:00
Jack Christensen
5952524511 Add Hijack and Construct
fixes #9
2020-01-17 17:38:56 -06:00
Jack Christensen
8be01d690f Make Host comment more precise 2020-01-17 17:38:07 -06:00
Jack Christensen
595780be0f Map io.EOF errors to io.ErrUnexpectedEOF
io.EOF is never expected during valid usage. In addition, database/sql
uses io.EOF as a sentinal value that all rows from a query have been
received.

See https://github.com/jackc/pgx/issues/662.
2020-01-17 16:55:05 -06:00
Jack Christensen
69048c281c Update changelog v4.2.1 2020-01-13 08:51:08 -06:00
Jack Christensen
4ec6ee76fe Update to pgconn v1.2.1 2020-01-13 08:50:28 -06:00
Jack Christensen
e7dd01e064 Update changelog 2020-01-13 08:48:32 -06:00
Jack Christensen
2582879459 Fix typo - rename ayncClose to asyncClose 2020-01-12 16:28:56 -06:00
Jack Christensen
0df97353b8 Fix racy usage of pgConn.contextWatcher in ayncClose 2020-01-12 16:27:46 -06:00
Jack Christensen
7a394d5c78 Update changelog v4.2.0 2020-01-11 19:25:23 -06:00
Jack Christensen
fce41c0b24 Update pgconn and pgtype 2020-01-11 19:23:53 -06:00
Jack Christensen
186f4b3539 Update changelog 2020-01-11 19:15:23 -06:00
Jack Christensen
a48e9bf63c Update changelog 2020-01-11 19:07:39 -06:00
Jack Christensen
fd2093cef8 Add statement type convenience methods to CommandTag and optimize
Added convenient way to check whether a statement was a select, insert,
update, or delete. These methods do not allocate.

RowsAffected now does not allocate even when a large number of rows are
affected. It also is multiple times faster, though the absolute change
is inconsequential.
2020-01-11 18:42:31 -06:00
Jack Christensen
b6669ae6dd Add PgError.SQLState method
fixes #15
2020-01-11 18:23:41 -06:00
Jack Christensen
70bb7ab6cb Merge branch 'bakape-master' 2020-01-11 18:10:33 -06:00
Jack Christensen
ed1391568c Merge branch 'master' of git://github.com/bakape/pgconn into bakape-master 2020-01-11 18:08:34 -06:00
bakape
9decdbc2ec Revert nil context support 2020-01-11 16:53:50 +02:00
Jack Christensen
98b3c57584 Try to cancel any in-progress query when a conn is closed by ctx cancel
See https://github.com/jackc/pgx/issues/659
2020-01-08 10:03:54 -06:00
Jack Christensen
be13c7ac54
Merge pull request #657 from malstoun/panicfix
Add arguments count check to execParamsAndPreparedPrefix
2020-01-04 08:29:19 -06:00
malstoun
8dc8431ef9 Add arguments count check to execParamsAndPreparedPrefix 2020-01-04 12:41:49 +03:00
bakape
9372218107 Don't synchronize with context.Background() 2020-01-01 19:34:56 +02:00
bakape
4d345164f1 Branch tests for nil context 2020-01-01 14:36:38 +02:00
bakape
7196234521 Benchmark nil context execution 2020-01-01 14:01:30 +02:00
bakape
89416dd805 Enable passing nil context 2020-01-01 13:09:50 +02:00
Jack Christensen
9cb58fc969 Fix large objects functionality when PreferSimpleProtocol = true
fixes #651
2019-12-27 11:17:12 -06:00
Jack Christensen
be1a8e51bc Add PG 12 to Travis test matrix 2019-12-23 11:08:21 -06:00
Jack Christensen
eb360b07be Tweak test for PG 12 compatibility 2019-12-23 11:08:21 -06:00
Jack Christensen
3e503b7b1a Add PostgreSQL 11 and 12 to the Travis build matrix 2019-12-21 14:41:09 -06:00
Jack Christensen
5fc867a833 Remove unused travis environment variable 2019-12-21 14:40:30 -06:00
Jack Christensen
18d1ed5ee5 Remove PostgreSQL 9.3 from Travis build matrix
PostgreSQL 9.3 is EOL so it doesn't make sense for pgconn to
specifically support. There are no known incompatibilities but it will
not longer be tested.
2019-12-21 14:37:09 -06:00
Jack Christensen
dd53b7488d Restart signalMessage when receiving non-error message in CopyFrom
fixes #21
2019-12-21 11:52:45 -06:00
Jack Christensen
bd0ce203e9 CopyFrom not table test was failing with syntax error 2019-12-21 10:31:27 -06:00
Jack Christensen
c7502af68b Add PostgreSQL time type support
fixes #15
2019-12-19 21:35:35 -06:00
Yuli Khodorkovskiy
1c20e7d36e Fix malformed SASL messages
Per the PG documentation [0], an AuthenticationSASLContinue message has:

    AuthenticationSASLContinue (B)
	Byte1('R')
	    Identifies the message as an authentication request.
	Int32
	    Length of message contents in bytes, including self.
	Int32(11)
	    Specifies that this message contains a SASL challenge.
	Byten
	    SASL data, specific to the SASL mechanism being used.

The current implementation was mistakenly adding the lengh of msg bytes
in between the Int32(11) and Byten. There was a similar issue for
AuthenticationSASLFinal.

[0] https://www.postgresql.org/docs/current/protocol-message-formats.html
2019-12-17 20:28:01 -05:00
Yuli Khodorkovskiy
e6b823d649 Add missing GSSEncRequest 2019-12-17 20:21:57 -05:00
Jack Christensen
2f2e01b9fc
Merge pull request #646 from johanbrandhorst/expose-default-driver
Add back GetDefaultDriver
2019-12-07 09:36:26 -06:00
Johan Brandhorst
d75362f396 Add back GetDefaultDriver
This method is useful when it is necessary
to wrap the pgx stdlib driver, for example to
add tracing and metrics.

Fixes #645
2019-12-07 10:19:51 +00:00
Jack Christensen
038f263a44 Add remaining int array conversions 2019-11-27 20:23:43 -06:00
Jack Christensen
52cb969ea1 Merge branch 'JohnnyQQQQ-master' 2019-11-27 20:17:12 -06:00
Jean-Philippe Quéméner
9ff83bc41c feat: add tests for less stricter numeric conversion 2019-11-26 17:31:13 +01:00
Jean-Philippe Quéméner
01ae643a48 feat: make conversion between numeric values and arrays less strict
closes https://github.com/jackc/pgx/issues/642
2019-11-26 17:11:54 +01:00
Jack Christensen
3dc25d5b9c
Merge pull request #640 from apantel/cockroach-test-cleanup
Clean up two test cases
2019-11-23 09:40:44 -06:00
Adam Pantel
167442e66b Add a couple error checks 2019-11-22 11:51:58 -05:00
Adam Pantel
f989008ad5 Clarify error reporting in TestConnQueryErrorWhileReturningRows 2019-11-22 11:03:46 -05:00
Adam Pantel
0a3cfab73e Eliminate race condition in TestListenNotifyWhileBusyIsSafe 2019-11-22 11:03:33 -05:00
Jack Christensen
32350bd1dc TestConnectCustomLookup must test with TCP connection
Test (correctly) fails if run on a Unix domain socket.
2019-11-18 07:29:57 -06:00
Jack Christensen
eb81d2926b Ignore errors sending Terminate message while closing connection
This mimics the behavior of libpq PGfinish.

refs #637
2019-11-18 07:29:57 -06:00
Jack Christensen
693ba65a4a Update pgtype to v1.0.3 2019-11-16 11:11:15 -06:00
Jack Christensen
7e1301257e Release 1.0.3 2019-11-16 11:10:32 -06:00