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

Method Format

pkg/sql/sem/tree/expr.go:986–1005  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

984
985// Format implements the NodeFormatter interface.
986func (node *Subquery) Format(ctx *FmtCtx) {
987 if ctx.HasFlags(FmtSymbolicSubqueries) {
988 ctx.Printf("@S%d", node.Idx)
989 } else {
990 // Ensure that type printing is disabled during the recursion, as
991 // the type annotations are not available in subqueries.
992 ctx.WithFlags(ctx.flags & ^FmtShowTypes, func() {
993 if node.Exists {
994 ctx.WriteString("EXISTS ")
995 }
996 if node.Select == nil {
997 // If the subquery is generated by the optimizer, we
998 // don't have an actual statement.
999 ctx.WriteString("<unknown>")
1000 } else {
1001 ctx.FormatNode(node.Select)
1002 }
1003 })
1004 }
1005}
1006
1007// TypedDummy is a dummy expression that represents a dummy value with
1008// a specified type. It can be used in situations where TypedExprs of a

Callers

nothing calls this directly

Calls 4

PrintfMethod · 0.80
WithFlagsMethod · 0.80
FormatNodeMethod · 0.80
HasFlagsMethod · 0.45

Tested by

no test coverage detected