From 187157e773f658987a6bba62edaf10dd9255254c Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Wed, 24 Apr 2019 13:43:37 -0500 Subject: [PATCH] Remove unused Batch.inTx --- batch.go | 7 ------- tx.go | 5 +++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/batch.go b/batch.go index c77deab8..a4184478 100644 --- a/batch.go +++ b/batch.go @@ -23,7 +23,6 @@ type Batch struct { resultsRead int ctx context.Context err error - inTx bool mrr *pgconn.MultiResultReader } @@ -33,12 +32,6 @@ func (c *Conn) BeginBatch() *Batch { return &Batch{conn: c} } -// BeginBatch returns a *Batch query for tx. Since this *Batch is already part -// of a transaction it will not automatically be wrapped in a transaction. -func (tx *Tx) BeginBatch() *Batch { - return &Batch{conn: tx.conn, inTx: true} -} - // Conn returns the underlying connection that b will or was performed on. func (b *Batch) Conn() *Conn { return b.conn diff --git a/tx.go b/tx.go index b28603b5..ab6a45e7 100644 --- a/tx.go +++ b/tx.go @@ -185,6 +185,11 @@ func (tx *Tx) CopyFrom(ctx context.Context, tableName Identifier, columnNames [] return tx.conn.CopyFrom(ctx, tableName, columnNames, rowSrc) } +// BeginBatch returns a *Batch query for the tx's connection. +func (tx *Tx) BeginBatch() *Batch { + return &Batch{conn: tx.conn} +} + // Status returns the status of the transaction from the set of // pgx.TxStatus* constants. func (tx *Tx) Status() int8 {