Skip to content

Commit

Permalink
db: Fix a arg mismatch between ...any and any on db.Client.NamedExec (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bt-justtrack authored Jul 19, 2024
1 parent 2b9f43d commit f490c9f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
8 changes: 4 additions & 4 deletions pkg/db/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type Client interface {
GetSingleScalarValue(ctx context.Context, query string, args ...interface{}) (int, error)
GetResult(ctx context.Context, query string, args ...interface{}) (*Result, error)
Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
NamedExec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
NamedExec(ctx context.Context, query string, arg interface{}) (sql.Result, error)
ExecMultiInTx(ctx context.Context, sqlers ...Sqler) (results []sql.Result, err error)
BindNamed(query string, arg interface{}) (string, []interface{}, error)
Prepare(ctx context.Context, query string) (*sql.Stmt, error)
Expand Down Expand Up @@ -209,10 +209,10 @@ func (c *ClientSqlx) Exec(ctx context.Context, query string, args ...interface{}
return res.(sql.Result), err
}

func (c *ClientSqlx) NamedExec(ctx context.Context, query string, args ...interface{}) (sql.Result, error) {
c.logger.Debug("> %s %q", query, args)
func (c *ClientSqlx) NamedExec(ctx context.Context, query string, arg interface{}) (sql.Result, error) {
c.logger.Debug("> %s %q", query, arg)

return c.db.NamedExecContext(ctx, query, args)
return c.db.NamedExecContext(ctx, query, arg)
}

func (c *ClientSqlx) ExecMultiInTx(ctx context.Context, sqlers ...Sqler) (results []sql.Result, err error) {
Expand Down
40 changes: 15 additions & 25 deletions pkg/db/mocks/Client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f490c9f

Please sign in to comment.