2
0

Adds RowsAffected for CopyToWriter and CopyFromReader

This commit is contained in:
Nikolay Vorobev
2018-12-12 18:41:47 +03:00
parent c59c9cac59
commit a0331e7409
6 changed files with 90 additions and 41 deletions
+4 -4
View File
@@ -240,18 +240,18 @@ func (tx *Tx) CopyFrom(tableName Identifier, columnNames []string, rowSrc CopyFr
}
// CopyFromReader delegates to the underlying *Conn
func (tx *Tx) CopyFromReader(r io.Reader, sql string) error {
func (tx *Tx) CopyFromReader(r io.Reader, sql string) (commandTag CommandTag, err error) {
if tx.status != TxStatusInProgress {
return ErrTxClosed
return CommandTag(""), ErrTxClosed
}
return tx.conn.CopyFromReader(r, sql)
}
// CopyToWriter delegates to the underlying *Conn
func (tx *Tx) CopyToWriter(w io.Writer, sql string, args ...interface{}) error {
func (tx *Tx) CopyToWriter(w io.Writer, sql string, args ...interface{}) (commandTag CommandTag, err error) {
if tx.status != TxStatusInProgress {
return ErrTxClosed
return CommandTag(""), ErrTxClosed
}
return tx.conn.CopyToWriter(w, sql, args...)