Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 24 | |
| 25 | // Format implements the NodeFormatter interface. |
| 26 | func (node *Prepare) Format(ctx *FmtCtx) { |
| 27 | ctx.WriteString("PREPARE ") |
| 28 | ctx.FormatNode(&node.Name) |
| 29 | if len(node.Types) > 0 { |
| 30 | ctx.WriteString(" (") |
| 31 | for i, t := range node.Types { |
| 32 | if i > 0 { |
| 33 | ctx.WriteString(", ") |
| 34 | } |
| 35 | ctx.WriteString(t.SQLString()) |
| 36 | } |
| 37 | ctx.WriteRune(')') |
| 38 | } |
| 39 | ctx.WriteString(" AS ") |
| 40 | ctx.FormatNode(node.Statement) |
| 41 | } |
| 42 | |
| 43 | // CannedOptPlan is used as the AST for a PREPARE .. AS OPT PLAN statement. |
| 44 | // This is a testing facility that allows execution (and benchmarking) of |
nothing calls this directly
no test coverage detected