Jack Christensen
be9ceaefe6
Add native Go slice support for strings and numbers to simple protocol
...
[]string, []int16, []int32, []int64, []int, []uint16, []uint32,
[]uint64, []uint, []float32, and []float64 are now supported in the
simple protocol like they are in the normal usage of the extended
protocol.
2020-04-11 09:27:07 -05:00
Jack Christensen
5f723da269
Merge pull request #716 from redbaron/row-values-doc
...
Clarify row type handling example
2020-04-10 13:19:28 -05:00
Maxim Ivanov
198f5093e8
Clarify row type handling example
2020-04-10 18:39:04 +01:00
Jack Christensen
3286f3111b
Merge pull request #715 from redbaron/row-values-doc
...
Document row and composite types handling
2020-04-10 12:04:53 -05:00
Maxim Ivanov
692e10f901
Document row and composite types handling
2020-04-10 17:08:56 +01:00
Jack Christensen
7a9efdefde
Merge pull request #712 from lbcjbb/master
...
[pgxpool] Fix connection leak if BeginTx() fail
2020-04-07 19:52:40 -05:00
Jean-Baptiste Bronisz
4127eba03f
[pgxpool] Fix connection leak if BeginTx() fail
2020-04-07 22:31:09 +02:00
Jack Christensen
e6af41a78a
Merge pull request #709 from georgysavva/flexible-pool-init
...
Add ability to skip network operations on pool initialization.
2020-04-04 07:54:28 -05:00
georgysavva
271f5a8a7d
revert go.sum
2020-04-03 10:56:40 +03:00
georgysavva
5d453485a9
Introduce new pool setting: LazyConnect
2020-04-03 10:28:05 +03:00
Jack Christensen
bc4586ac6f
Update to puddle v1.1.1
...
Fixes potential race condition if health check is creating new
connections while the pool is closed.
2020-04-02 22:24:09 -05:00
Jack Christensen
f76d37a387
Do not run timing sensitive test in parallel
...
This test
2020-04-02 22:24:09 -05:00
Jack Christensen
0329f12e05
Remove unneeded goroutine spawn in connection pool destructor
...
fixes #708
2020-04-02 22:24:09 -05:00
Jack Christensen
43c2113f90
Merge pull request #706 from georgysavva/wrapTx-context
...
add context to `stdlib.wrapTx{}`
2020-04-02 08:19:05 -05:00
georgysavva
7738775417
Include context into stdlib.wrapTx{} in order to propagate it to the underlying pgx.Tx.Commit() and Rollback() methods.
2020-04-02 15:30:55 +03:00
Jack Christensen
9188e32737
Merge pull request #704 from OberstK/patch-1
...
Fix of Link in Readme
2020-03-31 09:09:49 -05:00
Benjamin Kurczyk
e6e888b15c
Fix of Link in Readme
...
The Link to "tern" is wrong. This fixes it
2020-03-31 15:34:56 +02:00
Jack Christensen
27a069cea3
List pgerrcode in related libraries
2020-03-30 15:09:40 -05:00
Jack Christensen
14062fd19f
Link to related libraries
2020-03-30 15:08:35 -05:00
Jack Christensen
0446492fe9
Release v4.6.0
2020-03-30 11:35:02 -05:00
Jack Christensen
cdec57523d
Update to pgtype v1.3.0
2020-03-30 11:31:23 -05:00
Jack Christensen
da5c28239b
Update to pgconn v1.5.0
2020-03-30 11:21:43 -05:00
Jack Christensen
75f79ebc0f
Merge branch 'anicoll-microsecond_accuracy'
2020-03-27 16:03:14 -05:00
Andrew Nicoll
816e95d3ee
sanatize time to within microsecond accuracy
2020-03-27 13:03:36 +00:00
Jack Christensen
af03592c0f
Merge branch 'treebeardcpu-patch-2'
2020-03-25 20:26:13 -05:00
Jack Christensen
fef3ffc391
Link to pkg.go.dev instead of godoc.org
...
This is a big improvement because it can directly link to the v4 docs
instead of the pre-modules v3. The badge should be changed once the new
pkg.go.dev badge is available.
2020-03-25 20:24:20 -05:00
Jack Christensen
1dc45f1fa0
README.md tweaks
2020-03-25 20:23:04 -05:00
treebeardcpu
7ca7515087
README: improve flow and readability
...
Some grammatical changes, some formatting, some new text.
pgx is an excellent driver and deserves an excellent README :)
2020-03-25 19:59:24 -04:00
Jack Christensen
844dccf412
Merge pull request #692 from basvanbeek/early_bail
...
bail early if preloading rows.Next() results in rows.Err()
2020-03-21 10:58:16 -05:00
Jack Christensen
ed50e535c7
Update example readme
2020-03-19 20:50:11 -05:00
Bas van Beek
e75d315079
bail early if preloading rows.Next() results in rows.Err()
2020-03-17 19:50:23 +01:00
Jack Christensen
576f99a35e
Release v4.5.0
2020-03-07 13:32:17 -06:00
Jack Christensen
95907c29ce
Update pgconn and pull in fix for QueryRow with empty SQL
2020-03-07 13:27:01 -06:00
Jack Christensen
9e495df1d5
Add test for rollback failure
2020-02-29 09:48:16 -06:00
Jack Christensen
710ddf7134
Merge pull request #682 from WGH-/batch-len
...
Add Len() method to *pgx.Batch
2020-02-22 09:21:21 -06:00
Jack Christensen
edf1229fba
Merge pull request #681 from benjamin-bader/log_batched_queries
...
Add query logging for individual batch items
2020-02-22 09:19:34 -06:00
WGH
c01721e3ba
Add Len() method to *pgx.Batch
...
This makes the API slightly easier to use when number of calls to
Queue() cannot be trivially computed.
For example, if the program contains the loop like the following,
a separate variable counting the iterations is needed:
numHeaders := 0
for _, header := range prepareHeadersForInsert(*res.Headers) {
headerBatch.Queue("INSERT ...", ...)
numHeaders++
}
headerBatchResult := tx.SendBatch(ctx, headerBatch)
for i := 0; i < numHeaders; i++ {
_, err := headerBatchResult.Exec()
// ...
}
With method Len(), this extra variable can be eliminated.
2020-02-21 22:28:34 +03:00
Ben Bader
a10b89ebc0
Add query logging for individual batch items
2020-02-18 16:22:29 -08:00
Jack Christensen
542c9a97f1
Release v4.4.1
2020-02-14 17:59:33 -06:00
Jack Christensen
8848816c13
Update pgconn to v1.3.2 for better default buffer size
2020-02-14 17:58:38 -06:00
Jack Christensen
3b9f79e2f3
Fix race condition in CopyFrom
...
In case of an error it was possible for the goroutine that builds the
copy stream to still be running after CopyFrom returned. Since that
goroutine uses the connections ConnInfo data types to encode the copy
data it was possible for those types to be concurrently used in an
unsafe fashion.
CopyFrom will no longer return until that goroutine has completed.
2020-02-14 17:30:44 -06:00
Jack Christensen
8c9d1cc15b
Add test case for #677
2020-02-07 16:07:43 -06:00
Jack Christensen
ea0eacc0b6
Release v4.4.0
2020-02-05 11:31:22 -06:00
Jack Christensen
22ad987698
Add a timeout to pgxpool min connection creation
...
Ensure that CreateResource can't hang.
2020-02-05 11:25:15 -06:00
Jack Christensen
cb1a1ebefa
Update pgconn, pgtype, and puddle
2020-02-05 11:16:59 -06:00
Jack Christensen
efe9315b5b
Merge pull request #674 from ellulpatrick/min-connections
...
Implements MinConns, the minimum size of the connection pool
2020-02-03 17:07:04 -06:00
Patrick Ellul
a01827732f
Implements MinConns, the minimum size of the connection pool.
...
The health check will increase the number of connections to this amount if it had dropped below.
2020-02-04 08:17:53 +11:00
Jack Christensen
77c1076d39
stdlib.ReleaseConn closes connections left in invalid state
...
If a connection is in a transaction or has an open result set then
close the connection when returning it to database/sql. When next
database/sql attempts to use it the connection will return
driver.ErrBadConn and database/sql will remove it from the pool.
fixes #673
2020-02-01 12:00:26 -06:00
Jack Christensen
06c3181836
Merge branch 'ellulpatrick-max-conn-idle-time'
2020-02-01 09:45:37 -06:00
Jack Christensen
2d20ba7ba4
Add doc for pool_max_conn_idle_time option
2020-02-01 09:45:20 -06:00