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

Method doc

pkg/sql/sem/tree/pretty.go:875–905  ·  view source on GitHub ↗
(p *PrettyCfg)

Source from the content-addressed store, hash-verified

873}
874
875func (node *JoinTableExpr) doc(p *PrettyCfg) pretty.Doc {
876 // buf will contain the fully populated sequence of join keywords.
877 var buf bytes.Buffer
878 cond := pretty.Nil
879 if _, isNatural := node.Cond.(NaturalJoinCond); isNatural {
880 // Natural joins have a different syntax:
881 // "<a> NATURAL <join_type> [<join_hint>] JOIN <b>"
882 buf.WriteString("NATURAL ")
883 } else {
884 // Regular joins:
885 // "<a> <join type> [<join hint>] JOIN <b>"
886 if node.Cond != nil {
887 cond = p.Doc(node.Cond)
888 }
889 }
890
891 if node.JoinType != "" {
892 buf.WriteString(node.JoinType)
893 buf.WriteByte(' ')
894 if node.Hint != "" {
895 buf.WriteString(node.Hint)
896 buf.WriteByte(' ')
897 }
898 }
899 buf.WriteString("JOIN")
900
901 return p.joinNestedOuter(
902 buf.String(),
903 p.Doc(node.Left),
904 pretty.ConcatSpace(p.Doc(node.Right), cond))
905}
906
907func (node *OnJoinCond) doc(p *PrettyCfg) pretty.Doc {
908 e := node.Expr

Callers

nothing calls this directly

Calls 4

ConcatSpaceFunction · 0.92
DocMethod · 0.80
joinNestedOuterMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected