fix: failed to migrate
This commit is contained in:
+8
-1
@@ -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")
|
||||
@@ -144,7 +152,6 @@ type Tx interface {
|
||||
// called on the dbTx.
|
||||
type dbTx struct {
|
||||
conn *Conn
|
||||
err error
|
||||
savepointNum int64
|
||||
closed bool
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user