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

Method Format

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

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

159
160// Format implements the NodeFormatter interface.
161func (node *Restore) Format(ctx *FmtCtx) {
162 ctx.WriteString("RESTORE ")
163 if node.DescriptorCoverage == RequestedDescriptors {
164 ctx.FormatNode(&node.Targets)
165 ctx.WriteString(" ")
166 }
167 ctx.WriteString("FROM ")
168 if node.Subdir != nil {
169 ctx.FormatNode(node.Subdir)
170 ctx.WriteString(" IN ")
171 }
172 ctx.FormatURIs(node.From)
173 if node.AsOf.Expr != nil {
174 ctx.WriteString(" ")
175 ctx.FormatNode(&node.AsOf)
176 }
177 if !node.Options.IsDefault() {
178 ctx.WriteString(" WITH OPTIONS (")
179 ctx.FormatNode(&node.Options)
180 ctx.WriteString(")")
181 }
182}
183
184// KVOption is a key-value option.
185type KVOption struct {

Callers

nothing calls this directly

Calls 3

FormatNodeMethod · 0.80
FormatURIsMethod · 0.80
IsDefaultMethod · 0.45

Tested by

no test coverage detected