Jack Christensen
ecc9203ef4
Merge pull request #2336 from pashagolub/fix-docs-links
...
fix documentation links
2025-06-25 19:44:25 -05:00
Pavlo Golub
33163eefca
fix documentation links
2025-06-12 16:01:14 +02:00
Jack Christensen
d2ee7464e8
Merge pull request #2335 from flimzy/acquireBailOut
...
Attempt to acquire a connection MaxConns + 1 times before aborting
2025-06-03 17:17:42 -05:00
Jack Christensen
1320d13f8a
Merge pull request #2333 from costela/patch-1
...
chore(docs): add mention to otelpgx lib
2025-06-03 17:14:33 -05:00
Jonathan Hall
f118bb6033
Attempt to acquire a connection MaxConns + 1 times before aborting
2025-06-03 15:09:37 -04:00
Leo Antunes
b0572f79e6
chore(docs): add mention to otelpgx lib
2025-06-03 09:05:22 +02:00
Jack Christensen
4015a0c123
Merge pull request #2329 from flimzy/prepareConn
...
Add PrepareConn hook, which extends BeforeAcquire's behavior to allow…
2025-05-31 09:55:27 -05:00
Jonathan Hall
48d27a9fff
Add PrepareConn hook, which extends BeforeAcquire's behavior to allow canceling the instigating query
...
- BeforeAcquire now marked as deprecated, and re-implemented in terms of PrepareConn
- PrepareConn now takes precidence over BeforeAcquire if both are provided
- New tests added, so both old and new behavior are tested
- One niggle: AcquireAllIdle does not return an error, so the only recourse
that seems reasonable when PrepareConn returns an error in that context,
is to destroy the connection. This more or less retains the spirit of
existing functionality, without changing the public API of that method.
Although maybe an error-returning variant would be a useful addition as
well.
2025-05-21 11:41:04 -04:00
Jack Christensen
fc334e4c75
Merge pull request #2322 from Nomlsbad/better-parse-config-errors
...
Use `ParseConfigError` in `pgx.ParseConfig` and `pgxpool.ParseConfig`
2025-05-18 09:03:38 -05:00
Yurasov Ilia
3f5509fe98
fix: remove fmt import from the pgxpool
2025-05-18 02:28:24 +03:00
Jack Christensen
15bca4a4e1
Release v5.7.5
v5.7.5
2025-05-17 17:14:14 -05:00
Jack Christensen
1d557f9116
Remove PlanScan memoization
...
Previously, PlanScan used a cache to improve performance. However, the
cache could get confused in certain cases. For example, the following
would fail:
m := pgtype.NewMap()
var err error
var tags any
err = m.Scan(pgtype.TextArrayOID, pgx.TextFormatCode, []byte("{foo,bar,baz}"), &tags)
require.NoError(t, err)
var cells [][]string
err = m.Scan(pgtype.TextArrayOID, pgx.TextFormatCode, []byte("{{foo,bar},{baz,quz}}"), &cells)
require.NoError(t, err)
This commit removes the memoization and adds a test to ensure that this
case works.
The benchmarks were also updated to include an array of strings to
ensure this path is benchmarked. As it turned out, there was next to no
performance difference between the cached and non-cached versions.
It's possible there may be a performance impact in certain complicated
cases, but I have not encountered any. If there are any performance
issues, we can optimize the narrower case rather than adding memoization
everywhere.
2025-05-17 16:34:01 -05:00
Jack Christensen
de7fe81d78
Use reflect.TypeFor instead of reflect.TypeOf
...
Simplified function became available in Go 1.22.
2025-05-17 09:11:31 -05:00
Jack Christensen
d9eb089bd7
Remove unused function
2025-05-17 09:09:07 -05:00
Jack Christensen
6be24eb08d
Fix comment typo
2025-05-17 09:01:55 -05:00
Jack Christensen
07871c0a34
Zero internal baseRows references to allow GC earlier
...
See https://github.com/jackc/pgx/pull/2269
2025-05-17 08:39:54 -05:00
Yurasov Ilia
de806a11e7
fix: return pgconn.ParseConfigError inside ParseConfig functions
2025-05-14 03:50:09 +03:00
Yurasov Ilia
ce13266e90
fix: move pgconn.NewParseConfigError to errors.go
...
Move pgconn.NewParseConfigError function to errors.go from
export_test.go for creatin pgconn.ParseConfigError inside the pgx and
pgxpool packages.
2025-05-14 03:43:21 +03:00
Jack Christensen
777e7e5cdf
Merge pull request #2313 from stampy88/tracelog_pool_additions
...
Implement AcquireTracer and ReleaseTracer for TraceLog
2025-05-10 11:30:57 -05:00
dave sinclair
151bd026ec
Switched to LogLevelDebug
2025-05-10 12:28:26 -04:00
Jack Christensen
540fcaa9b9
Add support for PGOPTIONS environment variable
...
Match libpq behavior for PGOPTIONS environment variable. See
https://www.postgresql.org/docs/current/libpq-envars.html
2025-05-10 11:09:39 -05:00
Jack Christensen
3a248e3822
Add support for PGTZ environment variable
...
Match libpq behavior for PGTZ environment variable. See
https://www.postgresql.org/docs/current/libpq-envars.html
2025-05-10 10:58:35 -05:00
dave sinclair
baca2d848a
Implement AcquireTracer and ReleaseTracer for TraceLog
...
- `TraceLog` now implements the `pgxpool.AcquireTracer` and `pgxpool.ReleaseTracer` interfaces to log connection pool interactions.
2025-05-08 16:28:21 -04:00
Jack Christensen
c911d86cff
Merge pull request #2309 from dzherb/fix_doc
...
chore: fix typo in doc
2025-05-03 13:46:46 -05:00
dzherb
2bac99e2ae
chore: fix typo
2025-04-28 20:58:11 +03:00
Jack Christensen
c92d0a9045
Update golang.org/x/crypto to v0.37.0
...
This required bumping the minimum Go version to 1.23.0.
2025-04-26 10:09:29 -05:00
Jack Christensen
e9aad0fb0b
Add test for tracer within transaction
...
https://github.com/jackc/pgx/issues/2304
2025-04-26 09:55:31 -05:00
Jack Christensen
9e7f38cd50
Merge pull request #2302 from usernameisnull/pgconn-error
...
chore: should be pgconn.PgError
2025-04-17 08:52:47 -05:00
bing.ma
e779a5c072
chore: should be pgconn.PgError
2025-04-17 18:30:06 +08:00
Jack Christensen
ff9c26d851
Make OpenDBFromPool docs explicit about closing the *sql.DB
...
https://github.com/jackc/pgx/issues/2295
2025-04-05 09:01:11 -05:00
Jack Christensen
0f77a2d028
Merge pull request #2293 from divyam234/master
...
feat: add support for direct sslnegotiation
2025-03-31 08:13:19 -05:00
divyam234
ddd966f09f
update
2025-03-31 15:06:55 +02:00
divyam234
924834b5b4
add pgmock tests
2025-03-31 15:02:07 +02:00
divyam234
9b15554c51
respect sslmode set by user
2025-03-30 16:35:43 +02:00
divyam234
037e4cf9a2
feat: add support for direct sslnegotiation
2025-03-30 16:21:52 +02:00
Jack Christensen
04bcc0219d
Add v5.7.4 to changelog
v5.7.4
2025-03-24 20:04:45 -05:00
Jack Christensen
0e0a7d8344
Merge pull request #2288 from felix-roehrich/fr/fix-plan-scan
...
Revert change in `if` from #2236 .
2025-03-24 19:46:22 -05:00
Felix Röhrich
63422c7d6c
revert change in if
2025-03-24 15:01:50 +01:00
Jack Christensen
5c1fbf4806
Update changelog for v5.7.3
v5.7.3
2025-03-21 21:02:03 -05:00
Jack Christensen
05fe5f8b05
Explain seemingly redundant rows.Close() in CollectOneRow
...
fixes https://github.com/jackc/pgx/issues/2282
2025-03-21 20:33:32 -05:00
Jack Christensen
70c9a147a2
Merge pull request #2279 from djahandarie/min-idle-conns
...
Add MinIdleConns
2025-03-21 20:25:19 -05:00
Darius Jahandarie
6603ddfbe4
add MinIdleConns
2025-03-15 19:14:26 +09:00
Jack Christensen
70f7cad222
Add link to https://github.com/Arlandaren/pgxWrappy
2025-02-28 20:59:28 -06:00
Jack Christensen
6bf1b0b1b9
Add database/sql to overview of scanning
2025-02-22 08:42:26 -06:00
Jack Christensen
14bda65a0c
Correct pgtype docs
2025-02-22 08:34:31 -06:00
Jack Christensen
9e3c4fb40f
Merge pull request #2257 from felix-roehrich/fr/change-connect-logic
...
Change connection logic to be more forgiving
2025-02-19 07:36:35 -06:00
Felix Röhrich
05e72a5ab1
make connection logic more forgiving
2025-02-17 21:24:38 +01:00
Jack Christensen
47d631e34b
Added missed change to v5.7.2 changelog
2025-02-08 10:21:39 -06:00
Jack Christensen
58b05f567c
Add https://github.com/nikolayk812/pgx-outbox to README.md
...
fixes https://github.com/jackc/pgx/issues/2239
2025-01-25 08:59:52 -06:00
Jack Christensen
dcb7193669
Merge pull request #2236 from felix-roehrich/fr/fix-plan-scan
...
Alternative implementation for JSONCodec.PlanScan
2025-01-25 08:56:38 -06:00