Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 178 | |
| 179 | // Format implements the NodeFormatter interface. |
| 180 | func (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). |
nothing calls this directly
no test coverage detected