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

Method doc

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

Source from the content-addressed store, hash-verified

776}
777
778func (node *WindowDef) doc(p *PrettyCfg) pretty.Doc {
779 rows := make([]pretty.TableRow, 0, 4)
780 if node.RefName != "" {
781 rows = append(rows, p.row("", p.Doc(&node.RefName)))
782 }
783 if len(node.Partitions) > 0 {
784 rows = append(rows, p.row("PARTITION BY", p.Doc(&node.Partitions)))
785 }
786 if len(node.OrderBy) > 0 {
787 rows = append(rows, node.OrderBy.docRow(p))
788 }
789 if node.Frame != nil {
790 rows = append(rows, node.Frame.docRow(p))
791 }
792 if len(rows) == 0 {
793 return pretty.Text("()")
794 }
795 return p.bracket("(", p.rlTable(rows...), ")")
796}
797
798func (wf *WindowFrame) docRow(p *PrettyCfg) pretty.TableRow {
799 kw := "RANGE"

Callers

nothing calls this directly

Calls 6

TextFunction · 0.92
rowMethod · 0.80
DocMethod · 0.80
bracketMethod · 0.80
rlTableMethod · 0.80
docRowMethod · 0.45

Tested by

no test coverage detected