2
0

Partial conversion of pgx to use pgconn

This commit is contained in:
Jack Christensen
2019-01-26 16:46:30 -06:00
parent e3d431d0df
commit d3a2c1c107
17 changed files with 877 additions and 1830 deletions
-19
View File
@@ -4,7 +4,6 @@ import (
"bytes"
"context"
"fmt"
"io"
"time"
"github.com/jackc/pgx/pgconn"
@@ -231,24 +230,6 @@ func (tx *Tx) CopyFrom(tableName Identifier, columnNames []string, rowSrc CopyFr
return tx.conn.CopyFrom(tableName, columnNames, rowSrc)
}
// CopyFromReader delegates to the underlying *Conn
func (tx *Tx) CopyFromReader(r io.Reader, sql string) (commandTag pgconn.CommandTag, err error) {
if tx.status != TxStatusInProgress {
return "", ErrTxClosed
}
return tx.conn.CopyFromReader(r, sql)
}
// CopyToWriter delegates to the underlying *Conn
func (tx *Tx) CopyToWriter(w io.Writer, sql string, args ...interface{}) (commandTag pgconn.CommandTag, err error) {
if tx.status != TxStatusInProgress {
return "", ErrTxClosed
}
return tx.conn.CopyToWriter(w, sql, args...)
}
// Status returns the status of the transaction from the set of
// pgx.TxStatus* constants.
func (tx *Tx) Status() int8 {