(p *PrettyCfg)
| 729 | } |
| 730 | |
| 731 | func (node *FuncExpr) doc(p *PrettyCfg) pretty.Doc { |
| 732 | d := p.Doc(&node.Func) |
| 733 | |
| 734 | if len(node.Exprs) > 0 { |
| 735 | args := node.Exprs.doc(p) |
| 736 | if node.Type != 0 { |
| 737 | args = pretty.ConcatLine( |
| 738 | pretty.Text(funcTypeName[node.Type]), |
| 739 | args, |
| 740 | ) |
| 741 | } |
| 742 | |
| 743 | if node.AggType == GeneralAgg && len(node.OrderBy) > 0 { |
| 744 | args = pretty.ConcatSpace(args, node.OrderBy.doc(p)) |
| 745 | } |
| 746 | d = pretty.Concat(d, p.bracket("(", args, ")")) |
| 747 | } else { |
| 748 | d = pretty.Concat(d, pretty.Text("()")) |
| 749 | } |
| 750 | if node.AggType == OrderedSetAgg && len(node.OrderBy) > 0 { |
| 751 | args := node.OrderBy.doc(p) |
| 752 | d = pretty.Concat(d, p.bracket("WITHIN GROUP (", args, ")")) |
| 753 | } |
| 754 | if node.Filter != nil { |
| 755 | d = pretty.Fold(pretty.ConcatSpace, |
| 756 | d, |
| 757 | pretty.Keyword("FILTER"), |
| 758 | p.bracket("(", |
| 759 | p.nestUnder(pretty.Keyword("WHERE"), p.Doc(node.Filter)), |
| 760 | ")")) |
| 761 | } |
| 762 | if window := node.WindowDef; window != nil { |
| 763 | var over pretty.Doc |
| 764 | if window.Name != "" { |
| 765 | over = p.Doc(&window.Name) |
| 766 | } else { |
| 767 | over = p.Doc(window) |
| 768 | } |
| 769 | d = pretty.Fold(pretty.ConcatSpace, |
| 770 | d, |
| 771 | pretty.Keyword("OVER"), |
| 772 | over, |
| 773 | ) |
| 774 | } |
| 775 | return d |
| 776 | } |
| 777 | |
| 778 | func (node *WindowDef) doc(p *PrettyCfg) pretty.Doc { |
| 779 | rows := make([]pretty.TableRow, 0, 4) |
nothing calls this directly
no test coverage detected