Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 26 | |
| 27 | // Format implements the NodeFormatter interface. |
| 28 | func (node *SetVar) Format(ctx *FmtCtx) { |
| 29 | if node.ResetAll { |
| 30 | ctx.WriteString("RESET ALL") |
| 31 | return |
| 32 | } |
| 33 | if node.Reset { |
| 34 | ctx.WriteString("RESET ") |
| 35 | ctx.WithFlags(ctx.flags & ^FmtAnonymize & ^FmtMarkRedactionNode, func() { |
| 36 | // Session var names never contain PII and should be distinguished |
| 37 | // for feature tracking purposes. |
| 38 | ctx.FormatNameP(&node.Name) |
| 39 | }) |
| 40 | return |
| 41 | } |
| 42 | ctx.WriteString("SET ") |
| 43 | if node.Local { |
| 44 | ctx.WriteString("LOCAL ") |
| 45 | } |
| 46 | if node.SetRow { |
| 47 | ctx.WriteString("ROW (") |
| 48 | ctx.FormatNode(&node.Values) |
| 49 | ctx.WriteString(")") |
| 50 | } else { |
| 51 | ctx.WithFlags(ctx.flags & ^FmtAnonymize & ^FmtMarkRedactionNode, func() { |
| 52 | // Session var names never contain PII and should be distinguished |
| 53 | // for feature tracking purposes. |
| 54 | ctx.FormatNameP(&node.Name) |
| 55 | }) |
| 56 | |
| 57 | ctx.WriteString(" = ") |
| 58 | ctx.FormatNode(&node.Values) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | // SetClusterSetting represents a SET CLUSTER SETTING statement. |
| 63 | type SetClusterSetting struct { |
nothing calls this directly
no test coverage detected