Move code from UpdateBuilder.Exec to UpdateBuilder.ExecContext
This commit is contained in:
parent
900ce23197
commit
26a0aaaf27
|
@ -189,6 +189,10 @@ func (b *UpdateBuilder) ToSql() (string, []interface{}) {
|
||||||
// Exec executes the statement represented by the UpdateBuilder
|
// Exec executes the statement represented by the UpdateBuilder
|
||||||
// It returns the raw database/sql Result and an error if there was one
|
// It returns the raw database/sql Result and an error if there was one
|
||||||
func (b *UpdateBuilder) Exec() (sql.Result, error) {
|
func (b *UpdateBuilder) Exec() (sql.Result, error) {
|
||||||
|
return b.ExecContext(context.Background())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (b *UpdateBuilder) ExecContext(ctx context.Context) (sql.Result, error) {
|
||||||
sql, args := b.ToSql()
|
sql, args := b.ToSql()
|
||||||
|
|
||||||
fullSql, err := Interpolate(sql, args)
|
fullSql, err := Interpolate(sql, args)
|
||||||
|
@ -207,7 +211,3 @@ func (b *UpdateBuilder) Exec() (sql.Result, error) {
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *UpdateBuilder) ExecContext(ctx context.Context) (sql.Result, error) {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue