Create a new error here
(ctx context.Context, n ast.Node, q string, schema []string, np *named.ParamSet)
| 37 | // Create a new error here |
| 38 | |
| 39 | func (c *CachedAnalyzer) Analyze(ctx context.Context, n ast.Node, q string, schema []string, np *named.ParamSet) (*analysis.Analysis, error) { |
| 40 | result, rerun, err := c.analyze(ctx, n, q, schema, np) |
| 41 | if rerun { |
| 42 | if err != nil { |
| 43 | slog.Warn("first analysis failed with error", "err", err) |
| 44 | } |
| 45 | return c.a.Analyze(ctx, n, q, schema, np) |
| 46 | } |
| 47 | return result, err |
| 48 | } |
| 49 | |
| 50 | func (c *CachedAnalyzer) analyze(ctx context.Context, n ast.Node, q string, schema []string, np *named.ParamSet) (*analysis.Analysis, bool, error) { |
| 51 | // Only cache queries for managed databases. We can't be certain the |