From 26a0aaaf27bb704107b92037ffce9e1fa7f5e989 Mon Sep 17 00:00:00 2001 From: "v.veselskiy" Date: Thu, 24 Nov 2022 14:30:50 +0300 Subject: [PATCH] Move code from UpdateBuilder.Exec to UpdateBuilder.ExecContext --- update.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update.go b/update.go index 654f8b8..75afeed 100644 --- a/update.go +++ b/update.go @@ -189,6 +189,10 @@ func (b *UpdateBuilder) ToSql() (string, []interface{}) { // Exec executes the statement represented by the UpdateBuilder // It returns the raw database/sql Result and an error if there was one 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() fullSql, err := Interpolate(sql, args) @@ -207,7 +211,3 @@ func (b *UpdateBuilder) Exec() (sql.Result, error) { return result, nil } - -func (b *UpdateBuilder) ExecContext(ctx context.Context) (sql.Result, error) { - return nil, nil -}