3125 Commits

Author SHA1 Message Date
Jack Christensen
0f7b95c3a4 Merge remote-tracking branch 'pgconn/master' into v5-dev 2022-07-12 06:45:54 -05:00
Jack Christensen
3dc9d17757 Document new ResultReader.Values behavior 2022-07-11 21:17:45 -05:00
Jack Christensen
f0cd9cb867 Update CommandTag comment 2022-07-11 21:09:55 -05:00
Jack Christensen
aaacdbf3ea Use string internally for CommandTag 2022-07-11 21:09:03 -05:00
Jack Christensen
786de2bda8 Use correct cache 2022-07-11 20:42:55 -05:00
Jack Christensen
224393188d Fix InetCodec.DecodeValue 2022-07-11 08:07:23 -05:00
Jack Christensen
a059d1099f pgxpool pools always connect lazily
Rename constructor functions now that they don't actually connect.
2022-07-10 14:58:30 -05:00
Jack Christensen
ca41a6a222 Update docs 2022-07-10 14:32:08 -05:00
Jack Christensen
e7eb8a3250 Use netip package for representing inet and cidr types 2022-07-10 14:31:55 -05:00
Jack Christensen
7974a102fc Improve Scan error messages 2022-07-09 21:47:39 -05:00
Jack Christensen
b662ab6767 Better encode error message 2022-07-09 21:40:44 -05:00
Jack Christensen
731daea586 Skip test on CockroachDB 2022-07-09 21:08:15 -05:00
Jack Christensen
80a529fcb7 Test LoadType disambiguate name by schema 2022-07-09 17:48:46 -05:00
Jack Christensen
31ec18cc65 Replace Begin and BeginTx methods with functions 2022-07-09 17:25:55 -05:00
Jack Christensen
62f0347586 Add CollectOneRow 2022-07-09 16:59:29 -05:00
Jack Christensen
90c2dc6f68 Rename ForEachScannedRow to ForEachRow 2022-07-09 16:47:28 -05:00
Jack Christensen
da192291f7 Add CollectRows and RowTo* functions
Collect functionality was originally developed in pgxutil
2022-07-09 16:39:42 -05:00
Jack Christensen
3dafb5d4ee Skip test with non-standard CRDB behavior 2022-07-09 10:21:17 -05:00
Jack Christensen
c31b89a3f2 Delay handling invalidated statements when in transaction 2022-07-09 10:20:54 -05:00
Jack Christensen
e7aa76ccf9 SendBatch now uses pipeline mode to prepare and describe statements
Previously, a batch with 10 unique parameterized statements executed
100 times would entail 11 network round trips. 1 for each prepare /
describe and 1 for executing them all. Now pipeline mode is used to
prepare / describe all statements in a single network round trip. So it
would only take 2 round trips.
2022-07-09 09:32:36 -05:00
Jack Christensen
ba58e3d5d2 Fix pipeline prepare query without row results 2022-07-09 08:32:12 -05:00
Jack Christensen
76946fb5a3 Replace QueryFunc with ForEachScannedRow 2022-07-07 20:29:04 -05:00
Jack Christensen
a86f4f3db9 Add deallocate to pipeline mode 2022-07-07 19:32:01 -05:00
Jack Christensen
1168b375e4 Expose pgx functionality for manual integration with pgconn
This is primarily useful for using pipeline mode.
2022-07-04 13:29:49 -05:00
Jack Christensen
f7433cc5f2 Fix typo 2022-07-04 06:20:15 -05:00
Jack Christensen
f635b43a6b Use bigint in tests for CockroachDB compatibility
CRDB automatically changes int4 to int8.
2022-07-02 22:00:42 -05:00
Jack Christensen
a97ba0c34a Remove ReceiveResults
Pipeline mode should be used instead.
2022-07-02 21:50:07 -05:00
Jack Christensen
ae2881a23c Add pipeline mode to pgconn 2022-07-02 21:48:16 -05:00
sergey.bashilov
a18df2374a add ignore not preferred err flag in connect func 2022-07-02 07:04:50 -05:00
sergey.bashilov
cdc240d920 rename error 2022-07-02 07:04:50 -05:00
sergey.bashilov
618a12a094 remove HasPreferStandbyTargetSessionAttr, rename error to indicate server is not standby 2022-07-02 07:04:50 -05:00
sergey.bashilov
1b6543f29c fix typos 2022-07-02 07:04:50 -05:00
sergey.bashilov
25935a39b6 add prefer-standby target_session_attrs 2022-07-02 07:04:50 -05:00
Jack Christensen
ed3e9f1dd4 Check for more specific error 2022-07-01 15:33:12 -05:00
Jack Christensen
585022440b Update changelog v5.0.0-alpha.4 2022-06-25 18:11:39 -05:00
Jack Christensen
03da9fcec6 Check conn liveness before using when idle for more than 1 second
Implemented in pgxpool.Pool and database/sql.

https://github.com/jackc/pgx/issues/672
2022-06-25 17:58:53 -05:00
Jack Christensen
26eda0f86d Check for ENV conn string and skip test if missing 2022-06-25 16:55:09 -05:00
Jack Christensen
9afd320b9e Fix flickering test in CI
While this test always worked on my machine, it flickered in CI. And to
be fair the test can't guarantee the condition it is testing. Work
around this by trying many times before admitting failure.
2022-06-25 16:05:20 -05:00
Jack Christensen
72b1dcff2f Add pgconn.CheckConn 2022-06-25 15:55:09 -05:00
Jack Christensen
b068d53753 Fix race in test
Goroutine should have it's own err var instead of sharing.
2022-06-25 14:07:48 -05:00
Jack Christensen
125ee9670e Test TLS connection with pg_stat_ssl
Because of the nbconn wrapper it is no longer possible to check if the
conn is a *tls.Conn directly. This is actually a more reliable test
anyway.
2022-06-25 13:43:16 -05:00
Jack Christensen
82ca09e645 Numeric infinity only supported on PG 14+
Move to PG 14+ specific test
2022-06-25 13:33:09 -05:00
Jack Christensen
811d855a35 Add non-blocking IO
This eliminates an edge case that can cause a deadlock and is a
prerequisite to cheaply testing connection liveness and to recoving a
connection after a timeout.

https://github.com/jackc/pgconn/issues/27

Squashed commit of the following:

commit 0d7b0dddea1575e9fd72592665badb8cbdd581cc
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 25 13:15:05 2022 -0500

    Add test for non-blocking IO preventing deadlock

commit 79d68d23d38bb03ddb8bf13cb45792430eaf959a
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 18 18:23:24 2022 -0500

    Release CopyFrom buf when done

commit 95a43139c7b0b7557898c4480e5b3e42417ee3c0
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 18 18:22:32 2022 -0500

    Avoid allocations with non-blocking write

commit 6b63ceee076794bc4380495a55dd414dbbd08a43
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 18 17:46:49 2022 -0500

    Simplify iobufpool usage

commit 60ecdda02e5a24c894df4f58d31c485b90de5d5b
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 18 11:51:59 2022 -0500

    Add true non-blocking IO

commit 7dd26a34a182d4aacaed3bf8c09f9cc48a7b6156
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 4 20:28:23 2022 -0500

    Fix block when reading more than buffered

commit afa702213f1b6d24c976406448301b2be53b7f70
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 4 20:10:23 2022 -0500

    More TLS support

commit 51655bf8f40321d5f89bc3c02dd55fba0ac6aa49
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 4 17:46:00 2022 -0500

    Steps toward TLS

commit 2b80beb1ed75f0f58db8188b87753dbc26b62098
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 4 13:06:29 2022 -0500

    Litle more TLS support

commit 765b2c6e7b034ff6ffab3974579fd6ee7add593b
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 4 12:29:30 2022 -0500

    Add testing of TLS

commit 5b64432afbed9224f9512cc46624c88e7ebec625
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 4 09:48:19 2022 -0500

    Introduce testVariants in prep for TLS

commit ecebd7b103d4a9125c61e83f3651b950658b0b84
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 4 09:32:14 2022 -0500

    Handle and test read of previously buffered data

commit 09c64d8cf3ca5be1a31bef46bf78fa5cb9fae831
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 4 09:04:48 2022 -0500

    Rename nbbconn to nbconn

commit 73398bc67a7b7bd1aa044fb9b0546f4198ef92d2
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 4 08:59:53 2022 -0500

    Remove backup files

commit f1df39a29d23ae4e5175b92c69697f2bf9b4e112
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 4 08:58:05 2022 -0500

    Initial passing tests

commit ea3cdab234343fc9761d9b7966c5346179cd1b01
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat Jun 4 08:38:57 2022 -0500

    Fix connect timeout

commit ca22396789d120ff556f9704f4470268fbc8c0d8
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Thu Jun 2 19:32:55 2022 -0500

    wip

commit 2e7b46d5d7454daf0859dd48f8a8e190995164c5
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Mon May 30 08:32:43 2022 -0500

    Update comments

commit 7d04dc5caa80cb147929b6f65bab60a27baaff89
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat May 28 19:43:23 2022 -0500

    Fix broken test

commit bf1edc77d70465b4097a59c08c581033d2033ac6
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat May 28 19:40:33 2022 -0500

    fixed putting wrong size bufs

commit 1f7a855b2e4d1e14f85ac5f5683e2b93db0a4bd9
Author: Jack Christensen <jack@jackchristensen.com>
Date:   Sat May 28 18:13:47 2022 -0500

    initial not quite working non-blocking conn
2022-06-25 13:15:31 -05:00
Jack Christensen
c0a4d1b9ce Add a few tests 2022-06-20 20:43:56 -05:00
Jack Christensen
e12ba1b6b9 Extract iobufpool 2022-05-28 10:59:54 -05:00
Jack Christensen
7d5993d104 Add BenchmarkConnectClose 2022-05-28 06:32:39 -05:00
Oliver Tan
7ddbd74d5e stop ignoring ErrorResponse during GSS auth 2022-05-25 06:22:18 -05:00
Jack Christensen
bfaea9e7ec Fix rare race in CopyFrom 2022-05-24 08:26:37 -05:00
Jack Christensen
55e0b4c30e Skip CockroachDB in TestTrace 2022-05-23 18:15:53 -05:00
Jack Christensen
b59cd50508 TestTrace enables tracing after connection established
This avoids locking to a specific version of the server.
2022-05-23 17:52:10 -05:00