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

Method Format

postgres/parser/sem/tree/alter_type.go:180–194  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

178
179// Format implements the NodeFormatter interface.
180func (node *AlterTypeAddValue) Format(ctx *FmtCtx) {
181 ctx.WriteString(" ADD VALUE ")
182 if node.IfNotExists {
183 ctx.WriteString("IF NOT EXISTS ")
184 }
185 lex.EncodeSQLString(&ctx.Buffer, node.NewVal)
186 if node.Placement != nil {
187 if node.Placement.Before {
188 ctx.WriteString(" BEFORE ")
189 } else {
190 ctx.WriteString(" AFTER ")
191 }
192 lex.EncodeSQLString(&ctx.Buffer, node.Placement.ExistingVal)
193 }
194}
195
196// AlterTypeAddValuePlacement represents the placement clause for an ALTER
197// TYPE ADD VALUE command ([BEFORE | AFTER] value).

Callers

nothing calls this directly

Calls 2

EncodeSQLStringFunction · 0.92
WriteStringMethod · 0.80

Tested by

no test coverage detected