MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / validateBatch

Function validateBatch

internal/sql/validate/cmd.go:52–63  ·  view source on GitHub ↗
(n ast.Node)

Source from the content-addressed store, hash-verified

50}
51
52func validateBatch(n ast.Node) error {
53 funcs := astutils.Search(n, named.IsParamFunc)
54 params := astutils.Search(n, named.IsParamSign)
55 args := astutils.Search(n, func(n ast.Node) bool {
56 _, ok := n.(*ast.ParamRef)
57 return ok
58 })
59 if (len(params.Items) + len(funcs.Items) + len(args.Items)) == 0 {
60 return errors.New(":batch* commands require parameters")
61 }
62 return nil
63}
64
65func Cmd(n ast.Node, name, cmd string) error {
66 if cmd == metadata.CmdCopyFrom {

Callers 1

CmdFunction · 0.85

Calls 1

SearchFunction · 0.92

Tested by

no test coverage detected