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

Method doc

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

Source from the content-addressed store, hash-verified

681}
682
683func (node *FuncExpr) doc(p *PrettyCfg) pretty.Doc {
684 d := p.Doc(&node.Func)
685
686 if len(node.Exprs) > 0 {
687 args := node.Exprs.doc(p)
688 if node.Type != 0 {
689 args = pretty.ConcatLine(
690 pretty.Text(funcTypeName[node.Type]),
691 args,
692 )
693 }
694
695 if len(node.OrderBy) > 0 {
696 args = pretty.ConcatSpace(args, node.OrderBy.doc(p))
697 }
698 d = pretty.Concat(d, p.bracket("(", args, ")"))
699 } else {
700 d = pretty.Concat(d, pretty.Text("()"))
701 }
702 if node.Filter != nil {
703 d = pretty.Fold(pretty.ConcatSpace,
704 d,
705 pretty.Keyword("FILTER"),
706 p.bracket("(",
707 p.nestUnder(pretty.Keyword("WHERE"), p.Doc(node.Filter)),
708 ")"))
709 }
710 if window := node.WindowDef; window != nil {
711 var over pretty.Doc
712 if window.Name != "" {
713 over = p.Doc(&window.Name)
714 } else {
715 over = p.Doc(window)
716 }
717 d = pretty.Fold(pretty.ConcatSpace,
718 d,
719 pretty.Keyword("OVER"),
720 over,
721 )
722 }
723 return d
724}
725
726func (node *WindowDef) doc(p *PrettyCfg) pretty.Doc {
727 rows := make([]pretty.TableRow, 0, 4)

Callers

nothing calls this directly

Calls 10

ConcatLineFunction · 0.92
TextFunction · 0.92
ConcatSpaceFunction · 0.92
ConcatFunction · 0.92
FoldFunction · 0.92
KeywordFunction · 0.92
DocMethod · 0.80
bracketMethod · 0.80
nestUnderMethod · 0.80
docMethod · 0.65

Tested by

no test coverage detected