diff --git a/action_upsert.go b/action_upsert.go index d5e353e..025c941 100644 --- a/action_upsert.go +++ b/action_upsert.go @@ -102,7 +102,7 @@ func (s Service) Upsert(payload UpsertPayload) { pretty.Println("stm -", stm) pretty.Println("args -", args) - if _, err := s.DB.ExecContext(ctx, stm, args); err != nil { + if _, err := s.DB.ExecContext(ctx, stm, args...); err != nil { logger.Error("devicemngt - Upsert: Create new", logger.LogData{ "payload": payload, "error": err.Error(), @@ -131,7 +131,7 @@ func (s Service) Upsert(payload UpsertPayload) { pretty.Println("stm -", stm) pretty.Println("args -", args) - if _, err := s.DB.ExecContext(ctx, stm, args); err != nil { + if _, err := s.DB.ExecContext(ctx, stm, args...); err != nil { logger.Error("devicemngt - Upsert: Update", logger.LogData{ "payload": payload, "error": err.Error(), diff --git a/find_by_device_id.go b/find_by_device_id.go index 53843ed..70a95c4 100644 --- a/find_by_device_id.go +++ b/find_by_device_id.go @@ -10,7 +10,7 @@ import ( func (s Service) findByDeviceID(ctx context.Context, id string) (result Device) { stm, args, _ := s.Builder.Select("*").From(TableDeviceMngt).Where("device_id = ?", id).ToSql() - if err := s.DB.GetContext(ctx, &result, stm, args...); err != nil { + if err := s.DB.SelectContext(ctx, &result, stm, args...); err != nil { logger.Error("devicemngt - findByDeviceID", logger.LogData{ "device_id": id, "error": err.Error(),