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

Method docTable

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

Source from the content-addressed store, hash-verified

554}
555
556func (node *SelectClause) docTable(p *PrettyCfg) []pretty.TableRow {
557 if node.TableSelect {
558 return []pretty.TableRow{p.row("TABLE", p.Doc(node.From.Tables[0]))}
559 }
560 exprs := node.Exprs.doc(p)
561 if node.Distinct {
562 if node.DistinctOn != nil {
563 exprs = pretty.ConcatLine(p.Doc(&node.DistinctOn), exprs)
564 } else {
565 exprs = pretty.ConcatLine(pretty.Keyword("DISTINCT"), exprs)
566 }
567 }
568 return []pretty.TableRow{
569 p.row("SELECT", exprs),
570 node.From.docRow(p),
571 node.Where.docRow(p),
572 node.GroupBy.docRow(p),
573 node.Having.docRow(p),
574 node.Window.docRow(p),
575 }
576}
577
578func (node *From) doc(p *PrettyCfg) pretty.Doc {
579 return p.unrow(node.docRow(p))

Callers 1

docMethod · 0.95

Calls 6

ConcatLineFunction · 0.92
KeywordFunction · 0.92
rowMethod · 0.80
DocMethod · 0.80
docMethod · 0.65
docRowMethod · 0.45

Tested by

no test coverage detected