MCPcopy Create free account
hub / github.com/dolthub/doltgresql / Format

Method Format

postgres/parser/sem/tree/expr.go:1059–1078  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

1057
1058// Format implements the NodeFormatter interface.
1059func (node *Subquery) Format(ctx *FmtCtx) {
1060 if ctx.HasFlags(FmtSymbolicSubqueries) {
1061 ctx.Printf("@S%d", node.Idx)
1062 } else {
1063 // Ensure that type printing is disabled during the recursion, as
1064 // the type annotations are not available in subqueries.
1065 ctx.WithFlags(ctx.flags & ^FmtShowTypes, func() {
1066 if node.Exists {
1067 ctx.WriteString("EXISTS ")
1068 }
1069 if node.Select == nil {
1070 // If the subquery is generated by the optimizer, we
1071 // don't have an actual statement.
1072 ctx.WriteString("<unknown>")
1073 } else {
1074 ctx.FormatNode(node.Select)
1075 }
1076 })
1077 }
1078}
1079
1080// BinaryOperator represents a binary operator.
1081type BinaryOperator int

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected