MCPcopy Create free account
hub / github.com/dolthub/doltgresql / Format

Method Format

postgres/parser/sem/tree/create_aggregate.go:105–177  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

103
104// Format implements the NodeFormatter interface.
105func (node *CreateAggOption) Format(ctx *FmtCtx) {
106 switch node.Option {
107 case AggOptTypeSSpace:
108 ctx.WriteString("SSPACE = ")
109 ctx.FormatNode(node.IntVal)
110 case AggOptTypeFinalFunc:
111 ctx.WriteString("FINALFUNC = ")
112 ctx.FormatNode(node.FuncName)
113 case AggOptTypeFinalFuncExtra:
114 if node.BoolVal {
115 ctx.WriteString("FINALFUNC_EXTRA = TRUE")
116 } else {
117 ctx.WriteString("FINALFUNC_EXTRA = FALSE")
118 }
119 case AggOptTypeFinalFuncModify:
120 ctx.WriteString("FINALFUNC_MODIFY")
121 ctx.WriteString(string(node.FinalFuncModify))
122 case AggOptTypeCombineFunc:
123 ctx.WriteString("COMBINEFUNC = ")
124 ctx.FormatNode(node.FuncName)
125 case AggOptTypeSerialFunc:
126 ctx.WriteString("SERIALFUNC = ")
127 ctx.FormatNode(node.FuncName)
128 case AggOptTypeDeserialFunc:
129 ctx.WriteString("DESERIALFUNC = ")
130 ctx.FormatNode(node.FuncName)
131 case AggOptTypeInitCond:
132 ctx.WriteString("INITCOND = ")
133 ctx.FormatNode(node.CondVal)
134 case AggOptTypeMSFunc:
135 ctx.WriteString("MSFUNC = ")
136 ctx.FormatNode(node.FuncName)
137 case AggOptTypeMInvFunc:
138 ctx.WriteString("MINVFUNC = ")
139 ctx.FormatNode(node.FuncName)
140 case AggOptTypeMSType:
141 ctx.WriteString("MSTYPE = ")
142 ctx.WriteString(node.TypeVal.SQLString())
143 case AggOptTypeMSSpace:
144 ctx.WriteString("MSSPACE = ")
145 ctx.FormatNode(node.IntVal)
146 case AggOptTypeMFinalFunc:
147 ctx.WriteString("MFINALFUNC = ")
148 ctx.FormatNode(node.FuncName)
149 case AggOptTypeMFinalFuncExtra:
150 if node.BoolVal {
151 ctx.WriteString("MFINALFUNC_EXTRA = TRUE")
152 } else {
153 ctx.WriteString("MFINALFUNC_EXTRA = FALSE")
154 }
155 case AggOptTypeMFinalFuncModify:
156 ctx.WriteString("MFINALFUNC_MODIFY")
157 ctx.WriteString(string(node.FinalFuncModify))
158 case AggOptTypeMInitCond:
159 ctx.WriteString("MINITCOND = ")
160 ctx.FormatNode(node.CondVal)
161 case AggOptTypeSortOp:
162 ctx.WriteString("SORTOP = ")

Callers

nothing calls this directly

Calls 4

WriteStringMethod · 0.80
FormatNodeMethod · 0.80
SQLStringMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected