summaryrefslogtreecommitdiff
path: root/vendor/github.com/jackc/pgx/v5/tx.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-06-19 09:56:15 +0200
committerLibravatar GitHub <noreply@github.com>2023-06-19 09:56:15 +0200
commit70357a770f7e84eed1d3d6a0dfc2ce9f30e5c5be (patch)
tree7462b5e97a94a874b488404e2029fd182e9ae030 /vendor/github.com/jackc/pgx/v5/tx.go
parent[chore]: Bump golang.org/x/net from 0.10.0 to 0.11.0 (#1909) (diff)
downloadgotosocial-70357a770f7e84eed1d3d6a0dfc2ce9f30e5c5be.tar.xz
[chore]: Bump github.com/jackc/pgx/v5 from 5.3.1 to 5.4.1 (#1907)
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.3.1 to 5.4.1. - [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md) - [Commits](https://github.com/jackc/pgx/compare/v5.3.1...v5.4.1) --- updated-dependencies: - dependency-name: github.com/jackc/pgx/v5 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/jackc/pgx/v5/tx.go')
-rw-r--r--vendor/github.com/jackc/pgx/v5/tx.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/vendor/github.com/jackc/pgx/v5/tx.go b/vendor/github.com/jackc/pgx/v5/tx.go
index e57142a61..575c17a71 100644
--- a/vendor/github.com/jackc/pgx/v5/tx.go
+++ b/vendor/github.com/jackc/pgx/v5/tx.go
@@ -44,6 +44,10 @@ type TxOptions struct {
IsoLevel TxIsoLevel
AccessMode TxAccessMode
DeferrableMode TxDeferrableMode
+
+ // BeginQuery is the SQL query that will be executed to begin the transaction. This allows using non-standard syntax
+ // such as BEGIN PRIORITY HIGH with CockroachDB. If set this will override the other settings.
+ BeginQuery string
}
var emptyTxOptions TxOptions
@@ -53,6 +57,10 @@ func (txOptions TxOptions) beginSQL() string {
return "begin"
}
+ if txOptions.BeginQuery != "" {
+ return txOptions.BeginQuery
+ }
+
var buf strings.Builder
buf.Grow(64) // 64 - maximum length of string with available options
buf.WriteString("begin")