MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / formatCandidates

Function formatCandidates

pkg/sql/sem/tree/overload.go:862–886  ·  view source on GitHub ↗
(prefix string, candidates []overloadImpl)

Source from the content-addressed store, hash-verified

860}
861
862func formatCandidates(prefix string, candidates []overloadImpl) string {
863 var buf bytes.Buffer
864 for _, candidate := range candidates {
865 buf.WriteString(prefix)
866 buf.WriteByte('(')
867 params := candidate.params()
868 tLen := params.Length()
869 inputTyps := make([]TypedExpr, tLen)
870 for i := 0; i < tLen; i++ {
871 t := params.GetAt(i)
872 inputTyps[i] = &TypedDummy{Typ: t}
873 if i > 0 {
874 buf.WriteString(", ")
875 }
876 buf.WriteString(t.String())
877 }
878 buf.WriteString(") -> ")
879 buf.WriteString(returnTypeToFixedType(candidate.returnType(), inputTyps).String())
880 if candidate.preferred() {
881 buf.WriteString(" [preferred]")
882 }
883 buf.WriteByte('\n')
884 }
885 return buf.String()
886}

Callers 4

TypeCheckMethod · 0.85
TypeCheckMethod · 0.85
TypeCheckMethod · 0.85
typeCheckComparisonOpFunction · 0.85

Calls 7

returnTypeToFixedTypeFunction · 0.85
paramsMethod · 0.65
LengthMethod · 0.65
GetAtMethod · 0.65
StringMethod · 0.65
returnTypeMethod · 0.65
preferredMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…