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

Method Visit

internal/sql/validate/func_call.go:19–46  ·  view source on GitHub ↗
(node ast.Node)

Source from the content-addressed store, hash-verified

17}
18
19func (v *funcCallVisitor) Visit(node ast.Node) astutils.Visitor {
20 if v.err != nil {
21 return nil
22 }
23
24 call, ok := node.(*ast.FuncCall)
25 if !ok {
26 return v
27 }
28 fn := call.Func
29 if fn == nil {
30 return v
31 }
32
33 if fn.Schema == "sqlc" {
34 return nil
35 }
36
37 fun, err := v.catalog.ResolveFuncCall(call)
38 if fun != nil {
39 return v
40 }
41 if errors.Is(err, sqlerr.NotFound) && !v.settings.Package.StrictFunctionChecks {
42 return v
43 }
44 v.err = err
45 return nil
46}
47
48func FuncCall(c *catalog.Catalog, cs config.CombinedSettings, n ast.Node) error {
49 visitor := funcCallVisitor{catalog: c, settings: cs}

Callers

nothing calls this directly

Calls 1

ResolveFuncCallMethod · 0.80

Tested by

no test coverage detected