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

Method Format

pkg/sql/sem/tree/comment_on_database.go:22–31  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

20
21// Format implements the NodeFormatter interface.
22func (n *CommentOnDatabase) Format(ctx *FmtCtx) {
23 ctx.WriteString("COMMENT ON DATABASE ")
24 ctx.FormatNode(&n.Name)
25 ctx.WriteString(" IS ")
26 if n.Comment != nil {
27 lex.EncodeSQLStringWithFlags(&ctx.Buffer, *n.Comment, ctx.flags.EncodeFlags())
28 } else {
29 ctx.WriteString("NULL")
30 }
31}

Callers

nothing calls this directly

Calls 3

EncodeSQLStringWithFlagsFunction · 0.92
FormatNodeMethod · 0.80
EncodeFlagsMethod · 0.80

Tested by

no test coverage detected