Commit Graph

1860 Commits (2f95f67ef54b63b2caa5d5cc6940963159067249)

Author SHA1 Message Date
georgysavva a62de87342 Add ConnStr getter to Pool and Conn structs. 2020-05-16 18:10:29 +03:00
Jack Christensen 173227a6e3 Link to wiki from README. 2020-05-16 10:10:07 -05:00
Jack Christensen b1fc2870e5 go mod tidy 2020-05-16 08:21:04 -05:00
Jack Christensen f19b08628e Tweak docs to make conn / conn pool distinction clearer 2020-05-16 08:20:40 -05:00
Jack Christensen 1b54d15e93 Fix documentation error
fixes #749
2020-05-16 07:48:11 -05:00
Jack Christensen c65fd8e2df
Merge pull request #745 from un000/master
Properly close a pool on "not lazy" connect
2020-05-13 12:01:59 -05:00
Yegor Myskin 8dd3679f5a Properly close a pool on "not lazy" connect 2020-05-13 17:48:28 +03:00
Jack Christensen 64789acf46
Merge pull request #734 from georgysavva/stdlib-timeouts
Improve Stdlib context timeouts
2020-05-13 07:45:18 -05:00
Jack Christensen 94ba730bb1 Use simplified pgtype ScanPlan 2020-05-10 14:09:26 -05:00
Jack Christensen 38dd42de4b Support new pgtype format preferences 2020-05-10 14:09:02 -05:00
Jack Christensen aabe5538a8 Optimize large result sets 2020-05-09 23:57:20 -05:00
Jack Christensen e3519cfd75 Document supported versions 2020-05-09 10:24:58 -05:00
Jack Christensen a66b09fbd8 Improve simple protocol / text format
Increased data type support for simple protocol. Improved test
coverage of simple protocol. This has the additional advantage of
exercising the text encoders and decoders.
2020-05-08 16:20:15 -05:00
Jack Christensen c3381c6911 Replace t.Fatal with require where possible 2020-05-08 12:47:47 -05:00
Jack Christensen ec53234e86 Rename ensureConnValid to ensureDBValid 2020-05-08 12:26:24 -05:00
Jack Christensen c44cda4bb4 Clean up old Go 1.10 build tags
pgx requires Go modules which requires at least Go 1.11 so there is no
use in build tags to support older Go versions.
2020-05-08 12:18:09 -05:00
Jack Christensen c03ac1519e Improve stdlib performance with large result sets
In a hot path type assertions are expensive. Cache the already correctly
typed interfaces. ~20% improvement with 1000 rows.

Before:

jack@glados ~/dev/pgx/stdlib ±master » PGX_BENCH_SELECT_ROWS_COUNTS='1 10 1000' got ./... -bench=SelectRows -benchmem
goos: darwin
goarch: amd64
pkg: github.com/jackc/pgx/v4/stdlib
BenchmarkSelectRowsScanSimple/1_rows-16         	   21465	     55060 ns/op	    1679 B/op	      40 allocs/op
BenchmarkSelectRowsScanSimple/10_rows-16        	   16692	     71176 ns/op	    3827 B/op	     148 allocs/op
BenchmarkSelectRowsScanSimple/1000_rows-16      	     800	   1369547 ns/op	  248855 B/op	   12938 allocs/op
BenchmarkSelectRowsScanNull/1_rows-16           	   20306	     57883 ns/op	    1940 B/op	      54 allocs/op
BenchmarkSelectRowsScanNull/10_rows-16          	   15942	     74729 ns/op	    4294 B/op	     171 allocs/op
BenchmarkSelectRowsScanNull/1000_rows-16        	     829	   1326788 ns/op	  261291 B/op	   13051 allocs/op
PASS
ok  	github.com/jackc/pgx/v4/stdlib	10.429s

After:

jack@glados ~/dev/pgx/stdlib ±master » PGX_BENCH_SELECT_ROWS_COUNTS='1 10 1000' got ./... -bench=SelectRows -benchmem
goos: darwin
goarch: amd64
pkg: github.com/jackc/pgx/v4/stdlib
BenchmarkSelectRowsScanSimple/1_rows-16         	   21327	     55097 ns/op	    2127 B/op	      43 allocs/op
BenchmarkSelectRowsScanSimple/10_rows-16        	   16724	     69496 ns/op	    4276 B/op	     151 allocs/op
BenchmarkSelectRowsScanSimple/1000_rows-16      	    1009	   1124573 ns/op	  250037 B/op	   12941 allocs/op
BenchmarkSelectRowsScanNull/1_rows-16           	   20577	     58117 ns/op	    2396 B/op	      57 allocs/op
BenchmarkSelectRowsScanNull/10_rows-16          	   16402	     72533 ns/op	    4750 B/op	     174 allocs/op
BenchmarkSelectRowsScanNull/1000_rows-16        	    1010	   1161437 ns/op	  261735 B/op	   13054 allocs/op
PASS
ok  	github.com/jackc/pgx/v4/stdlib	10.363s
2020-05-08 00:06:42 -05:00
Jack Christensen dea915e605 Compare binary and text format through pgx
Make ID field bigger -- otherwise all ints are less than 4 digits and
get a bit too much of an advantage in text vs. binary
2020-05-07 22:28:46 -05:00
Jack Christensen e439372d2a Add multi-row select benchmarks 2020-05-07 22:28:46 -05:00
Jack Christensen f18351f61c Use ++ instead of += 1 2020-05-07 22:28:46 -05:00
Jack Christensen f9ce8af5c9 Add explicit enum support 2020-05-07 22:28:46 -05:00
Jack Christensen 71fb93a96c Add CopyFrom with enum test 2020-05-07 22:28:46 -05:00
georgysavva e27a6e71b5 Wrap stdlib Conn.Close() and Stmt.Close() with default 5 seconds timeout. 2020-05-02 16:57:39 +03:00
georgysavva e5920c3ad9 Merge branch 'master' of github.com:jackc/pgx 2020-05-02 15:01:11 +03:00
Jack Christensen 3c5d72a8d9
Merge pull request #733 from dchenk/patch-1
Small typo fixed
2020-04-30 19:15:06 -05:00
Dmitriy 830193dc36
Small typo fixed 2020-04-29 22:23:46 -07:00
Jack Christensen 63428b802d
Merge pull request #731 from felixge/patch-1
Fix typo in readme
2020-04-28 10:47:33 -05:00
Felix Geisendörfer 23a4edc0d7
Fix typo in readme 2020-04-28 11:33:33 +02:00
georgysavva 5364a47e05 Update go.sum via go mod tidy 2020-04-13 21:20:24 +03:00
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