Add ctx to PrepareEx
Remove PrepareExContext
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user