Commit Graph

1923 Commits (23b4656fc573dcecd8bdce9c0235249e73d384f4)

Author SHA1 Message Date
Don2Quixote 23b4656fc5 Made error check conditions clearer 2021-08-09 08:41:07 -05:00
Jack Christensen 8f33ed07cd Release v4.13.0 2021-07-24 10:59:24 -05:00
Jack Christensen 24f1d26fde Upgrade pgconn and pgtype 2021-07-24 10:55:24 -05:00
Jack Christensen 640aa07df1 Temporary step to clean up go.sum 2021-07-24 10:39:13 -05:00
Michael Darr 59fa1868a7 Support time durations for simple protocol
Signed-off-by: Michael Darr <michael.e.darr@gmail.com>
2021-07-17 09:01:57 -05:00
KeiichiHirobe 1470d69c58 go mod tidy 2021-07-17 08:39:31 -05:00
KeiichiHirobe 48f39340b3 switch from github.com/go-kit/kit/log to github.com/go-kit/log 2021-07-17 08:39:31 -05:00
Jack Christensen 9ee04e87e3 Release v4.12.0 2021-07-10 10:06:00 -05:00
Jack Christensen 785f279272 Upgrade dependencies 2021-07-10 10:02:16 -05:00
Nicholas Wilson aafa04c156 Use zap.Any for handling interface{} -> zap.Field conversion
zap.Any falls back to zap.Reflect, but is better for this case, because
it first checks for the types that zap handles specially.  For example,
time.Duration, or error, which zap.Reflect will just treat as untyped
int64 or struct objects, but zap.Any is able to detect these types and
print them properly.
2021-07-06 20:18:16 -05:00
Aliaksandr Mianzhynski 4a2209a1b4 Don't allocate buffer when tx opts are empty 2021-06-26 10:52:09 -05:00
Dmytro Haranzha cabb58cc40 ResetSession hook is called before a connection is reused from pool for another query. 2021-06-12 13:48:31 -05:00
dkinder 00feeaa5c9 stdlib: style nit in RandomizeHostOrderFunc 2021-05-10 08:17:53 -05:00
dkinder a8020a21e8 stdlib: add OptionBeforeConnect and randomizer
Fixes https://github.com/jackc/pgconn/issues/71
2021-05-10 08:17:53 -05:00
alex e722ca608c added url connection example 2021-04-17 09:56:17 -05:00
Andrew Kimball 3ab8941921 stdlib: Do not reuse ConnConfig strings
Previously, stdlib.RegisterConnConfig would sometimes reuse the same connection
string for different ConnConfig options (specifically, it happened when a connection
was open and then closed, and then a new, different connection was opened). This
behavior interferes with callers that expect that two connections with the same data
source name are connecting to the same backend database in the same way.

This fix updates stdlib.RegisterConnConfig to use an incrementing sequence
counter to uniquify all returned connection strings.

Fixes #947
2021-04-03 10:52:37 -05:00
Jonathan Amsterdam 88ede6efb5 stdlib: implement Conn.ResetSession
This prevents closed connections from being returned
by `database.sql.DB.Conn`.

Fixes #974.
2021-03-26 10:25:07 -05:00
Jack Christensen 909b81a163 Release v4.11.0 2021-03-25 10:21:28 -04:00
Jack Christensen 799cf1f04b Update copyright date 2021-03-25 10:08:09 -04:00
Jack Christensen 096f8ca754 Fix test in other time zones 2021-03-25 10:07:34 -04:00
Jack Christensen 2114ca9458 Update pgconn and pgtype 2021-03-25 09:59:38 -04:00
Jack Christensen a49f4bb135 Use errors instead of golang.org/x/xerrors 2021-03-25 09:55:12 -04:00
Jack Christensen 80147fd7cc Use sync.Once to guard pool.Close
This avoids the small possibility of 2 concurrent Close calls still
double closing the channel.
2021-03-19 08:58:56 -05:00
Matt Schultz fe366b2cf3 Prevent panics caused by attempting to close an already closed pgxpool.Pool. 2021-03-19 08:58:56 -05:00
Matt Schultz a0028cbd0d Handle SendBatch calls on closed transactions with null connections. This was previously panicking due to a null pointer exception as exposed in the provided unit test. 2021-03-19 08:38:19 -05:00
Jack Christensen 495d482f20 Fix PG version extraction in tests 2021-03-13 07:55:53 -06:00
Jack Christensen 1fcefdc73f Fix BeginTxFunc not passing txOptions
fixes #961
2021-03-13 07:43:08 -06:00
Rusakow Andrew 292539a590 Add comment support when sanitizing SQL queries 2021-03-13 07:31:56 -06:00
Jack Christensen 00704ce8b7 Skip test on too old PostgreSQL 2021-03-13 07:18:26 -06:00
Jack Christensen e93da6c744 Fix ignored deferred error with database/sql QueryRow
fixes #958
2021-03-13 06:52:58 -06:00
Jack Christensen 38ab93613b Make CopyFrom log message more specific 2021-03-11 19:22:40 -06:00
Patrick Hemmer 41fa6e844c Add logging on CopyFrom
Logging previously only logged statement results on Exec() and Query(), but not CopyFrom(). This makes change makes it consistent.
2021-03-11 19:21:42 -06:00
Jack Christensen 0cc35d7a60 Update supported versions 2021-03-06 17:25:15 -06:00
Jack Christensen d46e447a39 Add CockroachDB to CI 2021-03-06 17:21:45 -06:00
Jack Christensen 9e55cff611 Fix testing Fatalf in goroutines 2021-03-06 17:21:45 -06:00
Jack Christensen d245ed47f1 Increase pool release conn wait time for CI
No simple way around sleeping for certain tests.
2021-03-04 20:06:15 -06:00
Jack Christensen f8c43c97ab Document prefer_simple_protocol config option 2021-03-04 19:58:52 -06:00
Jack Christensen d9ac491657 Add prefer_simple_protocol option to ParseConfig
refs #650
2021-03-04 19:56:14 -06:00
Jack Christensen 1dc7133a63 Simplify CockroachDB detection 2021-02-27 10:40:06 -06:00
Jack Christensen 09371f21d0 Use JSON format compat with PG and CockroachDB 2021-02-27 10:28:45 -06:00
Jack Christensen fea4bc4318 Use bigint in tests for compat. with CockroachDB 2021-02-27 10:26:14 -06:00
Jack Christensen fb60d0780e Skip unsupported testing functionality on CockroachDB 2021-02-27 10:25:45 -06:00
Jack Christensen 2b63da6f12 Skip backend PID dependent tests on CockroachDB 2021-02-27 10:03:58 -06:00
Jack Christensen 1e15bdc874 Remove deferred from test tables where unneeded 2021-02-27 09:57:14 -06:00
Jack Christensen ff6ab48e00 Skip tests with parameter description server issues 2021-02-27 09:52:51 -06:00
Jack Christensen 674cf70c51 Skip tests with known server issues 2021-02-27 09:52:51 -06:00
Jack Christensen 775d3b1049 Fake success on example 2021-02-27 09:52:51 -06:00
Jack Christensen 30d44c0369 Test code instead of error message for CockroachDB 2021-02-27 09:52:51 -06:00
Jack Christensen 378bd72b67 Allow flexible number types for CockroachDB 2021-02-27 09:52:51 -06:00
Jack Christensen 44733732e4 Skip number type sensitive test on CockroachDB 2021-02-27 09:52:51 -06:00