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

Method Format

postgres/parser/sem/tree/set.go:53–73  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

51
52// Format implements the NodeFormatter interface.
53func (node *SetVar) Format(ctx *FmtCtx) {
54 ctx.WriteString("SET ")
55 if node.Name == "" {
56 ctx.WriteString("ROW (")
57 ctx.FormatNode(&node.Values)
58 ctx.WriteString(")")
59 } else {
60 ctx.WithFlags(ctx.flags & ^FmtAnonymize, func() {
61 // Session var names never contain PII and should be distinguished
62 // for feature tracking purposes.
63 ctx.FormatNameP(&node.Name)
64 })
65
66 if node.FromCurrent {
67 ctx.WriteString(" FROM CURRENT")
68 } else {
69 ctx.WriteString(" = ")
70 ctx.FormatNode(&node.Values)
71 }
72 }
73}
74
75var _ Statement = &SetSessionAuthorization{}
76

Callers

nothing calls this directly

Calls 4

WriteStringMethod · 0.80
FormatNodeMethod · 0.80
WithFlagsMethod · 0.80
FormatNamePMethod · 0.80

Tested by

no test coverage detected