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

Method Format

pkg/sql/sem/tree/expr.go:882–894  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

880
881// Format implements the NodeFormatter interface.
882func (node *Array) Format(ctx *FmtCtx) {
883 ctx.WriteString("ARRAY[")
884 ctx.FormatNode(&node.Exprs)
885 ctx.WriteByte(']')
886 // If the array has a type, add an annotation. Don't add it if the type is
887 // UNKNOWN[], since that's not a valid annotation.
888 if ctx.HasFlags(FmtParsable) && node.typ != nil {
889 if node.typ.ArrayContents().Family() != types.UnknownFamily {
890 ctx.WriteString(":::")
891 ctx.Buffer.WriteString(node.typ.SQLString())
892 }
893 }
894}
895
896// ArrayFlatten represents a subquery array constructor.
897type ArrayFlatten struct {

Callers 1

formatHideConstantsMethod · 0.95

Calls 5

FormatNodeMethod · 0.80
FamilyMethod · 0.80
ArrayContentsMethod · 0.80
SQLStringMethod · 0.80
HasFlagsMethod · 0.45

Tested by

no test coverage detected