Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 28 | |
| 29 | // Format implements the NodeFormatter interface. |
| 30 | func (node *CopyTo) Format(ctx *FmtCtx) { |
| 31 | ctx.WriteString("COPY ") |
| 32 | if node.Statement != nil { |
| 33 | ctx.WriteString("(") |
| 34 | ctx.FormatNode(node.Statement) |
| 35 | ctx.WriteString(")") |
| 36 | } else { |
| 37 | ctx.FormatNode(&node.Table) |
| 38 | if len(node.Columns) > 0 { |
| 39 | ctx.WriteString(" (") |
| 40 | ctx.FormatNode(&node.Columns) |
| 41 | ctx.WriteString(")") |
| 42 | } |
| 43 | } |
| 44 | ctx.WriteString(" TO STDOUT") |
| 45 | if !node.Options.IsDefault() { |
| 46 | ctx.WriteString(" WITH ") |
| 47 | ctx.FormatNode(&node.Options) |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | // CopyOptions describes options for COPY execution. |
| 52 | type CopyOptions struct { |
nothing calls this directly
no test coverage detected