2
0

Rename BeginEx to BeginTx and update docs

This commit is contained in:
Jack Christensen
2019-08-24 20:50:24 -05:00
parent ebf88b691f
commit b2b949afa4
6 changed files with 20 additions and 16 deletions
+3 -3
View File
@@ -68,12 +68,12 @@ var ErrTxCommitRollback = errors.New("commit unexpectedly resulted in rollback")
// Begin starts a transaction. Unlike database/sql, the context only affects the begin command. i.e. there is no
// auto-rollback on context cancelation.
func (c *Conn) Begin(ctx context.Context) (*dbTx, error) {
return c.BeginEx(ctx, TxOptions{})
return c.BeginTx(ctx, TxOptions{})
}
// BeginEx starts a transaction with txOptions determining the transaction mode. Unlike database/sql, the context only
// BeginTx starts a transaction with txOptions determining the transaction mode. Unlike database/sql, the context only
// affects the begin command. i.e. there is no auto-rollback on context cancelation.
func (c *Conn) BeginEx(ctx context.Context, txOptions TxOptions) (*dbTx, error) {
func (c *Conn) BeginTx(ctx context.Context, txOptions TxOptions) (*dbTx, error) {
_, err := c.Exec(ctx, txOptions.beginSQL())
if err != nil {
// begin should never fail unless there is an underlying connection issue or