Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 159 | |
| 160 | // Format implements the NodeFormatter interface. |
| 161 | func (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. |
| 185 | type KVOption struct { |
nothing calls this directly
no test coverage detected