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

Method Format

pkg/sql/sem/tree/cursor.go:171–186  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

169
170// Format implements the NodeFormatter interface.
171func (c CursorStmt) Format(ctx *FmtCtx) {
172 fetchType := c.FetchType.String()
173 if fetchType != "" {
174 ctx.WriteString(fetchType)
175 ctx.WriteString(" ")
176 }
177 if c.FetchType.HasCount() {
178 if ctx.HasFlags(FmtHideConstants) {
179 ctx.WriteByte('0')
180 } else {
181 ctx.WriteString(strconv.Itoa(int(c.Count)))
182 }
183 ctx.WriteString(" ")
184 }
185 ctx.FormatNode(&c.Name)
186}
187
188// Format implements the NodeFormatter interface.
189func (f FetchCursor) Format(ctx *FmtCtx) {

Callers

nothing calls this directly

Calls 4

HasCountMethod · 0.80
FormatNodeMethod · 0.80
StringMethod · 0.65
HasFlagsMethod · 0.45

Tested by

no test coverage detected