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

Method Format

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

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

968
969// Format implements the NodeFormatter interface.
970func (node *Subquery) Format(ctx *FmtCtx) {
971 if ctx.HasFlags(FmtSymbolicSubqueries) {
972 ctx.Printf("@S%d", node.Idx)
973 } else {
974 // Ensure that type printing is disabled during the recursion, as
975 // the type annotations are not available in subqueries.
976 ctx.WithFlags(ctx.flags & ^FmtShowTypes, func() {
977 if node.Exists {
978 ctx.WriteString("EXISTS ")
979 }
980 if node.Select == nil {
981 // If the subquery is generated by the optimizer, we
982 // don't have an actual statement.
983 ctx.WriteString("<unknown>")
984 } else {
985 ctx.FormatNode(node.Select)
986 }
987 })
988 }
989}
990
991// TypedDummy is a dummy expression that represents a dummy value with
992// 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