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

Method Format

pkg/sql/sem/tree/prepare.go:26–41  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

24
25// Format implements the NodeFormatter interface.
26func (node *Prepare) Format(ctx *FmtCtx) {
27 ctx.WriteString("PREPARE ")
28 ctx.FormatNode(&node.Name)
29 if len(node.Types) > 0 {
30 ctx.WriteString(" (")
31 for i, t := range node.Types {
32 if i > 0 {
33 ctx.WriteString(", ")
34 }
35 ctx.WriteString(t.SQLString())
36 }
37 ctx.WriteRune(')')
38 }
39 ctx.WriteString(" AS ")
40 ctx.FormatNode(node.Statement)
41}
42
43// CannedOptPlan is used as the AST for a PREPARE .. AS OPT PLAN statement.
44// This is a testing facility that allows execution (and benchmarking) of

Callers

nothing calls this directly

Calls 2

FormatNodeMethod · 0.80
SQLStringMethod · 0.80

Tested by

no test coverage detected