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

Method Format

pkg/sql/sem/tree/backup.go:75–99  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

73
74// Format implements the NodeFormatter interface.
75func (node *Backup) Format(ctx *FmtCtx) {
76 ctx.WriteString("BACKUP ")
77 if node.Targets != nil {
78 ctx.FormatNode(node.Targets)
79 ctx.WriteString(" ")
80 }
81 ctx.WriteString("INTO ")
82 if node.Subdir != nil {
83 ctx.FormatNode(node.Subdir)
84 ctx.WriteString(" IN ")
85 } else if node.AppendToLatest {
86 ctx.WriteString("LATEST IN ")
87 }
88 ctx.FormatURIs(node.To)
89 if node.AsOf.Expr != nil {
90 ctx.WriteString(" ")
91 ctx.FormatNode(&node.AsOf)
92 }
93
94 if !node.Options.IsDefault() {
95 ctx.WriteString(" WITH OPTIONS (")
96 ctx.FormatNode(&node.Options)
97 ctx.WriteString(")")
98 }
99}
100
101// Coverage return the coverage (all vs requested).
102func (node Backup) Coverage() DescriptorCoverage {

Callers

nothing calls this directly

Calls 3

FormatNodeMethod · 0.80
FormatURIsMethod · 0.80
IsDefaultMethod · 0.45

Tested by

no test coverage detected