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

Method Format

pkg/sql/sem/tree/copy.go:30–49  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

28
29// Format implements the NodeFormatter interface.
30func (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.
52type CopyOptions struct {

Callers

nothing calls this directly

Calls 2

FormatNodeMethod · 0.80
IsDefaultMethod · 0.45

Tested by

no test coverage detected