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

Method doc

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

Source from the content-addressed store, hash-verified

1568}
1569
1570func (node *IndexTableDef) doc(p *PrettyCfg) pretty.Doc {
1571 // Final layout:
1572 // [INVERTED] INDEX [name] (columns...)
1573 // [STORING ( ... )]
1574 // [INTERLEAVE ...]
1575 // [PARTITION BY ...]
1576 //
1577 title := pretty.Keyword("INDEX")
1578 if node.Name != "" {
1579 title = pretty.ConcatSpace(title, p.Doc(&node.Name))
1580 }
1581 if node.Inverted {
1582 title = pretty.ConcatSpace(pretty.Keyword("INVERTED"), title)
1583 }
1584 title = pretty.ConcatSpace(title, p.bracket("(", p.Doc(&node.Columns), ")"))
1585
1586 clauses := make([]pretty.Doc, 0, 4)
1587 if node.Sharded != nil {
1588 clauses = append(clauses, p.Doc(node.Sharded))
1589 }
1590 if node.Storing != nil {
1591 clauses = append(clauses, p.bracketKeyword(
1592 "STORING", "(",
1593 p.Doc(&node.Storing),
1594 ")", ""))
1595 }
1596 if node.Interleave != nil {
1597 clauses = append(clauses, p.Doc(node.Interleave))
1598 }
1599 if node.PartitionBy != nil {
1600 clauses = append(clauses, p.Doc(node.PartitionBy))
1601 }
1602
1603 if len(clauses) == 0 {
1604 return title
1605 }
1606 return p.nestUnder(title, pretty.Group(pretty.Stack(clauses...)))
1607}
1608
1609func (node *UniqueConstraintTableDef) doc(p *PrettyCfg) pretty.Doc {
1610 // Final layout:

Callers

nothing calls this directly

Calls 8

KeywordFunction · 0.92
ConcatSpaceFunction · 0.92
GroupFunction · 0.92
StackFunction · 0.92
DocMethod · 0.80
bracketMethod · 0.80
bracketKeywordMethod · 0.80
nestUnderMethod · 0.80

Tested by

no test coverage detected