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

Method Format

pkg/sql/sem/tree/values.go:96–111  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

94
95// Format implements the NodeFormatter interface.
96func (node *LiteralValuesClause) Format(ctx *FmtCtx) {
97 ctx.WriteString("VALUES ")
98 comma := ""
99 for i := 0; i < node.Rows.NumRows(); i++ {
100 ctx.WriteString(comma)
101 ctx.WriteByte('(')
102 comma2 := ""
103 for j := 0; j < node.Rows.NumCols(); j++ {
104 ctx.WriteString(comma2)
105 ctx.FormatNode(node.Rows.Get(i, j))
106 comma2 = ", "
107 }
108 ctx.WriteByte(')')
109 comma = ", "
110 }
111}

Callers

nothing calls this directly

Calls 4

FormatNodeMethod · 0.80
NumRowsMethod · 0.65
NumColsMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected