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

Method Pairs

internal/codegen/golang/query.go:57–77  ·  view source on GitHub ↗

Return the argument name and type for query methods. Should only be used in the context of method arguments.

()

Source from the content-addressed store, hash-verified

55// Return the argument name and type for query methods. Should only be used in
56// the context of method arguments.
57func (v QueryValue) Pairs() []Argument {
58 if v.isEmpty() {
59 return nil
60 }
61 if !v.EmitStruct() && v.IsStruct() {
62 var out []Argument
63 for _, f := range v.Struct.Fields {
64 out = append(out, Argument{
65 Name: escape(toLowerCase(f.Name)),
66 Type: f.Type,
67 })
68 }
69 return out
70 }
71 return []Argument{
72 {
73 Name: escape(v.Name),
74 Type: v.DefineType(),
75 },
76 }
77}
78
79func (v QueryValue) SlicePair() string {
80 if v.isEmpty() {

Callers 1

PairMethod · 0.95

Calls 6

isEmptyMethod · 0.95
EmitStructMethod · 0.95
IsStructMethod · 0.95
DefineTypeMethod · 0.95
escapeFunction · 0.85
toLowerCaseFunction · 0.85

Tested by

no test coverage detected