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
+2 -2
View File
@@ -70,8 +70,8 @@ func (c *Conn) Begin(ctx context.Context) (pgx.Tx, error) {
return c.Conn().Begin(ctx)
}
func (c *Conn) BeginEx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error) {
return c.Conn().BeginEx(ctx, txOptions)
func (c *Conn) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error) {
return c.Conn().BeginTx(ctx, txOptions)
}
func (c *Conn) Conn() *pgx.Conn {
+3 -3
View File
@@ -364,15 +364,15 @@ func (p *Pool) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults {
}
func (p *Pool) Begin(ctx context.Context) (pgx.Tx, error) {
return p.BeginEx(ctx, pgx.TxOptions{})
return p.BeginTx(ctx, pgx.TxOptions{})
}
func (p *Pool) BeginEx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error) {
func (p *Pool) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error) {
c, err := p.Acquire(ctx)
if err != nil {
return nil, err
}
t, err := c.BeginEx(ctx, txOptions)
t, err := c.BeginTx(ctx, txOptions)
if err != nil {
return nil, err
}