2
0

Add ctx to PrepareEx

Remove PrepareExContext
This commit is contained in:
Jack Christensen
2017-05-20 18:03:59 -05:00
parent d1fd222ca5
commit 8a7165dd98
7 changed files with 16 additions and 18 deletions
+3 -3
View File
@@ -174,16 +174,16 @@ func (tx *Tx) Exec(sql string, arguments ...interface{}) (commandTag CommandTag,
// Prepare delegates to the underlying *Conn
func (tx *Tx) Prepare(name, sql string) (*PreparedStatement, error) {
return tx.PrepareEx(name, sql, nil)
return tx.PrepareEx(context.Background(), name, sql, nil)
}
// PrepareEx delegates to the underlying *Conn
func (tx *Tx) PrepareEx(name, sql string, opts *PrepareExOptions) (*PreparedStatement, error) {
func (tx *Tx) PrepareEx(ctx context.Context, name, sql string, opts *PrepareExOptions) (*PreparedStatement, error) {
if tx.status != TxStatusInProgress {
return nil, ErrTxClosed
}
return tx.conn.PrepareEx(name, sql, opts)
return tx.conn.PrepareEx(ctx, name, sql, opts)
}
// Query delegates to the underlying *Conn