2
0

Conn.CopyFrom takes context

This commit is contained in:
Jack Christensen
2019-04-20 11:38:23 -05:00
parent 95756b1d7f
commit dc699cefc7
4 changed files with 15 additions and 14 deletions
+2 -2
View File
@@ -189,12 +189,12 @@ func (tx *Tx) QueryRow(ctx context.Context, sql string, args ...interface{}) Row
}
// CopyFrom delegates to the underlying *Conn
func (tx *Tx) CopyFrom(tableName Identifier, columnNames []string, rowSrc CopyFromSource) (int, error) {
func (tx *Tx) CopyFrom(ctx context.Context, tableName Identifier, columnNames []string, rowSrc CopyFromSource) (int, error) {
if tx.status != TxStatusInProgress {
return 0, ErrTxClosed
}
return tx.conn.CopyFrom(tableName, columnNames, rowSrc)
return tx.conn.CopyFrom(ctx, tableName, columnNames, rowSrc)
}
// Status returns the status of the transaction from the set of