|
|
@ -59,7 +59,7 @@ func executeWithClient(ctx *cli.Context, client *cl.Client, timer bool, stmt str
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
resp.Body.Close()
|
|
|
|
defer resp.Body.Close()
|
|
|
|
|
|
|
|
|
|
|
|
if resp.StatusCode != http.StatusOK {
|
|
|
|
if resp.StatusCode != http.StatusOK {
|
|
|
|
return fmt.Errorf("server responded with %s: %s", resp.Status, response)
|
|
|
|
return fmt.Errorf("server responded with %s: %s", resp.Status, response)
|
|
|
@ -87,14 +87,12 @@ func executeWithClient(ctx *cli.Context, client *cl.Client, timer bool, stmt str
|
|
|
|
if result.RowsAffected > 1 {
|
|
|
|
if result.RowsAffected > 1 {
|
|
|
|
rowString = "rows"
|
|
|
|
rowString = "rows"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if timer {
|
|
|
|
if timer {
|
|
|
|
ctx.String("%d %s affected (%f sec)\n", result.RowsAffected, rowString, result.Time)
|
|
|
|
ctx.String("%d %s affected (%f sec)\n", result.RowsAffected, rowString, result.Time)
|
|
|
|
} else {
|
|
|
|
fmt.Printf("Run Time: %f seconds\n", result.Time) // Move this line inside the if timer block
|
|
|
|
ctx.String("%d %s affected\n", result.RowsAffected, rowString)
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
ctx.String("%d %s affected\n", result.RowsAffected, rowString)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if timer {
|
|
|
|
|
|
|
|
fmt.Printf("Run Time: %f seconds\n", result.Time)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return hcr
|
|
|
|
return hcr
|
|
|
|
}
|
|
|
|
}
|
|
|
|