MCPcopy
hub / github.com/sqlc-dev/sqlc / Analyze

Method Analyze

internal/analyzer/analyzer.go:39–48  ·  view source on GitHub ↗

Create a new error here

(ctx context.Context, n ast.Node, q string, schema []string, np *named.ParamSet)

Source from the content-addressed store, hash-verified

37// Create a new error here
38
39func (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
50func (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

Callers

nothing calls this directly

Calls 2

analyzeMethod · 0.95
AnalyzeMethod · 0.65

Tested by

no test coverage detected