Skip to content

Commit

Permalink
Fix: show scan info only when timing config is verbose (#4315)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Destructive authored Jun 26, 2024
1 parent 7f88795 commit 8234b9b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/display/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,19 @@ func displayTable(ctx context.Context, result *queryresult.Result) (int, *queryr
}

func getTiming(result *queryresult.Result, count int) *queryresult.TimingResult {
if timingConfig := viper.GetString(constants.ArgTiming); timingConfig == constants.ArgOff || timingConfig == "false" {
timingConfig := viper.GetString(constants.ArgTiming)

if timingConfig == constants.ArgOff || timingConfig == "false" {
return nil
}
// now we have iterated the rows, get the timing
timingResult := <-result.TimingResult
// set rows returned
timingResult.RowsReturned = int64(count)

if timingConfig != constants.ArgVerbose {
timingResult.Scans = nil
}
return timingResult
}

Expand Down

0 comments on commit 8234b9b

Please sign in to comment.