Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 51 | |
| 52 | // Format implements the NodeFormatter interface. |
| 53 | func (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 | |
| 75 | var _ Statement = &SetSessionAuthorization{} |
| 76 |
nothing calls this directly
no test coverage detected