Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 15 | |
| 16 | // Format implements the NodeFormatter interface. |
| 17 | func (n *CommentOnTable) Format(ctx *FmtCtx) { |
| 18 | ctx.WriteString("COMMENT ON TABLE ") |
| 19 | ctx.FormatNode(n.Table) |
| 20 | ctx.WriteString(" IS ") |
| 21 | if n.Comment != nil { |
| 22 | // TODO(knz): Replace all this with ctx.FormatNode |
| 23 | // when COMMENT supports expressions. |
| 24 | if ctx.flags.HasFlags(FmtHideConstants) { |
| 25 | ctx.WriteString("'_'") |
| 26 | } else { |
| 27 | lexbase.EncodeSQLStringWithFlags(&ctx.Buffer, *n.Comment, ctx.flags.EncodeFlags()) |
| 28 | } |
| 29 | } else { |
| 30 | ctx.WriteString("NULL") |
| 31 | } |
| 32 | } |
nothing calls this directly
no test coverage detected