(ctx context.Context, queryCtx context.Context, resolvedQuery *modconfig.ResolvedQuery)
| 390 | } |
| 391 | |
| 392 | func (c *InteractiveClient) executeQuery(ctx context.Context, queryCtx context.Context, resolvedQuery *modconfig.ResolvedQuery) { |
| 393 | // if there is a custom search path, wait until the first connection of each plugin has loaded |
| 394 | if customSearchPath := c.client().GetCustomSearchPath(); customSearchPath != nil { |
| 395 | if err := connection_sync.WaitForSearchPathSchemas(ctx, c.client(), customSearchPath); err != nil { |
| 396 | error_helpers.ShowError(ctx, err) |
| 397 | return |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | t := time.Now() |
| 402 | result, err := c.client().Execute(queryCtx, resolvedQuery.ExecuteSQL, resolvedQuery.Args...) |
| 403 | if err != nil { |
| 404 | error_helpers.ShowError(ctx, error_helpers.HandleCancelError(err)) |
| 405 | // if timing flag is enabled, show the time taken for the query to fail |
| 406 | if cmdconfig.Viper().GetString(pconstants.ArgTiming) != pconstants.ArgOff { |
| 407 | querydisplay.DisplayErrorTiming(t) |
| 408 | } |
| 409 | } else { |
| 410 | c.promptResult.Streamer.StreamResult(result.Result) |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | func (c *InteractiveClient) getQuery(ctx context.Context, line string) *modconfig.ResolvedQuery { |
| 415 | // if it's an empty line, then we don't need to do anything |
no test coverage detected