martinpasaribu
dc3aea06b5
remove unused func and parameter
2024-12-22 23:48:08 +07:00
Lucas Hild
64ca07e31b
Add commit query to tx options
2024-09-23 16:46:58 +02:00
Jack Christensen
1a9b2a53a5
Fix staticcheck issues
2023-07-28 18:04:31 -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
ksco
8eb062f588
perf(tx): use strings.Builder to avoid the overhead of []byte -> string conversion
2022-11-25 12:39:22 -06:00
Petr Evdokimov
fbfafb3edf
Optimize 'beginSQL' runtime and memory allocations
2022-11-22 09:00:12 -06:00
Jack Christensen
3ad9995dfe
Exec checks if tx is closed
...
https://github.com/jackc/pgx/discussions/1350
2022-10-24 18:23:26 -05:00
Jack Christensen
31ec18cc65
Replace Begin and BeginTx methods with functions
2022-07-09 17:25:55 -05:00
Jack Christensen
76946fb5a3
Replace QueryFunc with ForEachScannedRow
2022-07-07 20:29:04 -05:00
Jack Christensen
1168b375e4
Expose pgx functionality for manual integration with pgconn
...
This is primarily useful for using pipeline mode.
2022-07-04 13:29:49 -05:00
Jack Christensen
1f4b34f932
Merge branch 'master' into v5-dev
2022-04-23 11:05:24 -05:00
Jack Christensen
f14fb3d692
Replace interface{} with any
2022-04-09 09:12:55 -05:00
Jack Christensen
3ce50c079e
Rename dbSavepoint to dbSimulatedNestedTx
...
https://github.com/jackc/pgx/issues/1161
2022-03-05 08:41:02 -06:00
Jack Christensen
9c5dfbdfb3
pgconn.CommandTag is now an opaque type
...
It now makes a copy instead of retaining driver memory. This is in
preparation to reuse the driver read buffer.
2022-02-12 10:26:26 -06: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
Jille Timmermans
1d606a91b8
Change constant definition syntax so they show up in godoc
...
for TxAccessMode, TxDeferrableMode and TxIsoLevel
After this commit, Godoc understands these are the valid values of these
types and shows them together in the documentation.
2021-11-22 09:47:15 -06:00
Dan Gillis
8876b3a4ff
Add comments
2021-09-11 11:07:31 -05:00
Don2Quixote
23b4656fc5
Made error check conditions clearer
2021-08-09 08:41:07 -05:00
Aliaksandr Mianzhynski
4a2209a1b4
Don't allocate buffer when tx opts are empty
2021-06-26 10:52:09 -05:00
Jack Christensen
a49f4bb135
Use errors instead of golang.org/x/xerrors
2021-03-25 09:55:12 -04:00
Jack Christensen
1fcefdc73f
Fix BeginTxFunc not passing txOptions
...
fixes #961
2021-03-13 07:43:08 -06:00
Jack Christensen
ac2918b9a3
Add BeginFunc and BeginTxFunc
...
fixes #821
2021-02-20 18:30:18 -06:00
Jack Christensen
e8f959e0e1
Add QueryFunc
...
refs #821
2020-12-12 09:39:58 -06:00
Jack Christensen
9b480f4785
Terminate connection when Commit fails and leaves tx open
...
refs #787
2020-07-13 22:49:35 -05:00
Jack Christensen
f8a5bc8273
Do not kill connection on transaction commit failure
...
fixes #780
2020-06-27 12:10:33 -05:00
Jack Christensen
f18351f61c
Use ++ instead of += 1
2020-05-07 22:28:46 -05:00
HowJMay
8e88d70eb3
fix: Fix typo
...
Fix some typos in codebase
2020-01-25 15:36:19 +08: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
15ea38aae5
Document interfaces that may have methods added in the future
2019-10-12 09:35:29 -05:00
Jack Christensen
143bc3165d
Add Conn() to Tx interface.
...
This is necessary to allow code using a Tx to access the *Conn (and
pgconn.PgConn) on which the Tx is executing.
2019-10-12 09:35:29 -05:00
Jack Christensen
c0a1f9976a
Conn.Begin and Conn.BeginTx return a Tx interface
...
This is necessary for the Conn.Begin method to signature as other
methods that begin a transaction. This is technically a breaking change
but practically is just a bug fix that is extremely unlikely to break
any existing code.
2019-10-12 09:35:29 -05:00
Jack Christensen
67a09e3a1f
Add more transaction docs
2019-09-19 22:34:10 -05:00
Jack Christensen
21c89003af
Check if dbSavepoint is already closed
2019-09-19 22:34:10 -05:00
Jack Christensen
cb841782a7
Fix spelling
2019-09-19 22:34:10 -05:00
Jack Christensen
585fac4561
Rollback should mark tx as closed
2019-09-19 22:34:10 -05:00
Jack Christensen
b2b949afa4
Rename BeginEx to BeginTx and update docs
2019-08-24 20:50:24 -05:00
Jack Christensen
3675337e5b
Update for rename of pgconn.PreparedStatementDescription
2019-08-24 20:44:56 -05:00
Jack Christensen
31705e586a
Use pgconn.PreparedStatementDescription directly
...
Instead of having similar pgx.PreparedStatement
2019-08-24 14:29:05 -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
64b4414efc
Remove unused exported error value
2019-08-17 15:56:36 -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
d93de3fdc7
Add CopyFrom to pool
2019-04-25 15:35:53 -05:00
Jack Christensen
7b1272d254
Add SendBatch to pool
2019-04-25 15:07:35 -05:00
Jack Christensen
aed6b822d9
Split batch command and result
2019-04-24 16:39:06 -05:00
Jack Christensen
187157e773
Remove unused Batch.inTx
2019-04-24 13:43:37 -05:00
Jack Christensen
2263521f70
Only have a single Begin transaction method
2019-04-24 13:35:27 -05:00
Jack Christensen
cc3461e65d
Use golang.org/x/xerrors
2019-04-20 17:43:44 -05:00
Jack Christensen
66625e6489
Prepare takes context
...
Also remove PrepareEx. It's primary usage was for context. Supplying
parameter OIDs is unnecessary when you can type cast in the query SQL.
If it does become necessary or desirable to add options back it can be
added in a backwards compatible way by adding a varargs as last
argument.
2019-04-20 11:47:16 -05:00
Jack Christensen
dc699cefc7
Conn.CopyFrom takes context
2019-04-20 11:38:23 -05:00