MCPcopy Create free account
hub / github.com/dolthub/doltgresql / docTable

Method docTable

postgres/parser/sem/tree/pretty.go:569–589  ·  view source on GitHub ↗
(p *PrettyCfg)

Source from the content-addressed store, hash-verified

567}
568
569func (node *SelectClause) docTable(p *PrettyCfg) []pretty.TableRow {
570 if node.TableSelect {
571 return []pretty.TableRow{p.row("TABLE", p.Doc(node.From.Tables[0]))}
572 }
573 exprs := node.Exprs.doc(p)
574 if node.Distinct {
575 if node.DistinctOn != nil {
576 exprs = pretty.ConcatLine(p.Doc(&node.DistinctOn), exprs)
577 } else {
578 exprs = pretty.ConcatLine(pretty.Keyword("DISTINCT"), exprs)
579 }
580 }
581 return []pretty.TableRow{
582 p.row("SELECT", exprs),
583 node.From.docRow(p),
584 node.Where.docRow(p),
585 node.GroupBy.docRow(p),
586 node.Having.docRow(p),
587 node.Window.docRow(p),
588 }
589}
590
591func (node *From) doc(p *PrettyCfg) pretty.Doc {
592 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