Commit Graph

49 Commits (0f77a2d028414a616da37d0a07813dfaf61e5d5f)

Author SHA1 Message Date
Jack Christensen 1a9b2a53a5 Fix staticcheck issues 2023-07-28 18:04:31 -05:00
Jack Christensen 05440f9d3f Drastically increase allowed test times for potato CI
The context timeouts for tests are designed to give a better error
message when something hangs rather than the test just timing out.
Unfortunately, the potato CI frequently has some test or another
randomly take a long time. While the increased times are somewhat less
than optimal on a real computer, hopefully this will solve the
flickering CI.
2023-07-11 21:16:08 -05:00
Jack Christensen 9a5ead9048 Add TxOptions.BeginQuery to allow overriding the default BEGIN query
https://github.com/jackc/pgx/issues/1643
2023-06-18 06:43:17 -05:00
Jack Christensen 31ec18cc65 Replace Begin and BeginTx methods with functions 2022-07-09 17:25:55 -05:00
Jack Christensen 83e50f21e8 Extract SkipCockroachDB to pgxtest 2022-04-02 10:35:13 -05:00
Jack Christensen 72cc95e4dd Bump module version to v5 2021-12-11 13:29:03 -06:00
Jack Christensen 0e293b966c Finish import of pgconn 2021-12-04 14:06:57 -06: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 1dc7133a63 Simplify CockroachDB detection 2021-02-27 10:40:06 -06:00
Jack Christensen 1e15bdc874 Remove deferred from test tables where unneeded 2021-02-27 09:57:14 -06:00
Jack Christensen 674cf70c51 Skip tests with known server issues 2021-02-27 09:52:51 -06:00
Jack Christensen eaf3e84963 Add timeout to serialization failure test
When run with CockroachDB it appears to hang without the timeout.
2021-02-27 09:52:51 -06:00
Jack Christensen bac0905915 Specify type for CockroachDB 2021-02-27 09:52:51 -06:00
Jack Christensen 9fe7962445 Skip another initially deferred test on CockroachDB 2021-02-27 09:52:51 -06:00
Jack Christensen 2e50e59491 Skip isolation level test for CockroachDB 2021-02-27 09:52:51 -06:00
Jack Christensen 2f95f67ef5 Remove initially deferred when not needed
Makes test compatible with CockroachDB.
2021-02-27 09:52:51 -06:00
Jack Christensen ac2918b9a3 Add BeginFunc and BeginTxFunc
fixes #821
2021-02-20 18:30:18 -06:00
Jack Christensen f8a5bc8273 Do not kill connection on transaction commit failure
fixes #780
2020-06-27 12:10:33 -05:00
Jack Christensen 9e495df1d5 Add test for rollback failure 2020-02-29 09:48:16 -06:00
Jack Christensen 78a83eba6a Fix dbSavepoint.Begin recursive self call
It needed to call the inner tx.

fixes #633
2019-10-22 20:38:12 -05:00
Jack Christensen b2b949afa4 Rename BeginEx to BeginTx and update docs 2019-08-24 20:50:24 -05:00
Jack Christensen 99e5461522 Add pgx.Tx interface and pseudo nested transaction support
This complicates the idea of a persistent transaction status and error
so that concept was removed.
2019-08-17 17:22:14 -05:00
Jack Christensen c3e41872a8 Resplit Begin and BeginEx
This is in preparation for a Begin / Tx interface that will similate
nested transactions with savepoints.

In addition, this passes the TxOptions struct by value and thereby
removes an allocation.
2019-08-17 15:53:55 -05:00
Jack Christensen 2263521f70 Only have a single Begin transaction method 2019-04-24 13:35:27 -05:00
Jack Christensen efb333df6b Fix go modules
Wow. This is fun. Sure is easy to get modules wrong when upgrading a v2+
project.
2019-04-20 17:41:08 -05:00
Jack Christensen 54c6ddc2f0 Commit and Rollback take context
Remove Ex versions.
2019-04-10 12:22:12 -05:00
Jack Christensen 7718ee6207 Remove Ex versions of Query and QueryRow
Always require context and prepend options to arguments if necessary.
2019-04-10 12:12:22 -05:00
Jack Christensen 77a2da2b46 Replace connection pool 2019-04-10 11:09:42 -05:00
Jack Christensen d2ad2ed5d8 Remove tests context cancel
Context cancellation is now fatal so no need to test recovery.
2019-04-05 11:00:35 -05:00
Jack Christensen 858d00788a Use extracted packages with Go modules 2019-04-05 10:59:47 -05:00
Jack Christensen 1257b89df7 Update main pgx package to compile with new pgconn 2019-01-05 19:00:41 -06:00
Jack Christensen 89c3d8af5d Remove ExecEx 2019-01-02 12:52:37 -06:00
Jack Christensen 12857ad05b Implement pgx.Conn.Exec in terms of pgconn.PgConn.Exec 2019-01-02 12:32:36 -06:00
Jack Christensen 356a6c43d2 Avoid allocating strings in common message types 2019-01-01 13:47:37 -06:00
Jack Christensen 378ccb8945 PG error type is *pgconn.PgError 2018-12-31 17:46:56 -06:00
Jack Christensen c672c0d595 Use environment variables for test configuration 2018-12-30 21:52:33 -06:00
Jack Christensen b3c8a73dc7 Restructure connect process
- Moved lots of connection logic to pgconn from pgx
- Extracted pgpassfile package
2018-12-30 16:55:56 -06:00
Valery Krivchikov c844a2402b Call context.WithTimeout cancel function 2018-09-15 13:23:09 +03:00
Jack Christensen f114ec85a1 Allow recovery from failed transaction
rollback to savepoint can recover a failed transaction. Therefore we
shouldn't block any activities while the transaction is broken. Instead
we only have the Tx.Status() method return the information.

refs #421
2018-05-12 19:53:53 -05:00
Jack Christensen 6f1c5cc3e6 Tx.Status handles in transaction error
refs #421
2018-05-12 10:26:25 -05:00
Jack Christensen d1fd222ca5 Add transaction context support 2017-05-20 17:58:19 -05:00
Jack Christensen 2a49569747 Remove AfterClose() and Conn() from Tx and Rows 2017-05-06 10:00:49 -05:00
Jack Christensen 430d4943c7 Replace BeginIso with BeginEx
Adds support for read/write mode and deferrable modes.
2016-12-31 11:48:45 -06:00
Jack Christensen b8486d6749 Fix Tx.status not being set on error on Commit
fixes #131
2016-03-24 15:11:04 -05:00
Jack Christensen 74b33db979 Fix unrecognized commit failure
Also add *Tx.Status() and *Tx.Err()
2016-02-13 12:47:06 -06:00
Jack Christensen 470002ec13 Fix test of *Tx.AfterClose order 2016-02-13 12:12:01 -06:00
Jack Christensen e8dcf5b3ac Add *Tx.AfterClose hook
ConnPool now implements its connection with Tx via this hook instead of
manipulating the internals of Tx.
2016-02-13 11:06:44 -06:00
Jack Christensen ae6a87545b Use database/sql style transaction interface 2014-07-12 07:59:30 -05:00
Jack Christensen f31665c5db wip 2014-07-12 07:11:16 -05:00