MCPcopy Create free account
hub / github.com/dolthub/doltgresql / Format

Method Format

postgres/parser/sem/tree/backup.go:214–243  ·  view source on GitHub ↗

Format implements the NodeFormatter interface

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

212
213// Format implements the NodeFormatter interface
214func (o *BackupOptions) Format(ctx *FmtCtx) {
215 var addSep bool
216 maybeAddSep := func() {
217 if addSep {
218 ctx.WriteString(", ")
219 }
220 addSep = true
221 }
222 if o.CaptureRevisionHistory {
223 ctx.WriteString("revision_history")
224 addSep = true
225 }
226
227 if o.EncryptionPassphrase != nil {
228 maybeAddSep()
229 ctx.WriteString("encryption_passphrase=")
230 o.EncryptionPassphrase.Format(ctx)
231 }
232
233 if o.Detached {
234 maybeAddSep()
235 ctx.WriteString("detached")
236 }
237
238 if o.EncryptionKMSURI != nil {
239 maybeAddSep()
240 ctx.WriteString("kms=")
241 o.EncryptionKMSURI.Format(ctx)
242 }
243}
244
245// CombineWith merges other backup options into this backup options struct.
246// An error is returned if the same option merged multiple times.

Callers

nothing calls this directly

Calls 2

WriteStringMethod · 0.80
FormatMethod · 0.65

Tested by

no test coverage detected