(p *PrettyCfg)
| 873 | } |
| 874 | |
| 875 | func (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 | |
| 907 | func (node *OnJoinCond) doc(p *PrettyCfg) pretty.Doc { |
| 908 | e := node.Expr |
nothing calls this directly
no test coverage detected