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

Method Format

pkg/sql/sem/tree/set.go:69–88  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

67
68// Format implements the NodeFormatter interface.
69func (node *SetClusterSetting) Format(ctx *FmtCtx) {
70 ctx.WriteString("SET CLUSTER SETTING ")
71
72 // Cluster setting names never contain PII and should be distinguished
73 // for feature tracking purposes.
74 ctx.WithFlags(ctx.flags & ^FmtAnonymize & ^FmtMarkRedactionNode, func() {
75 ctx.FormatNameP(&node.Name)
76 })
77
78 ctx.WriteString(" = ")
79
80 switch v := node.Value.(type) {
81 case *DBool, *DInt:
82 ctx.WithFlags(ctx.flags & ^FmtAnonymize & ^FmtMarkRedactionNode, func() {
83 ctx.FormatNode(v)
84 })
85 default:
86 ctx.FormatNode(v)
87 }
88}
89
90// SetTransaction represents a SET TRANSACTION statement.
91type SetTransaction struct {

Callers

nothing calls this directly

Calls 3

WithFlagsMethod · 0.80
FormatNamePMethod · 0.80
FormatNodeMethod · 0.80

Tested by

no test coverage detected