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

Method doc

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

Source from the content-addressed store, hash-verified

1962}
1963
1964func (node *Import) doc(p *PrettyCfg) pretty.Doc {
1965 items := make([]pretty.TableRow, 0, 5)
1966 items = append(items, p.row("IMPORT", pretty.Nil))
1967
1968 if node.Bundle {
1969 if node.Table != nil {
1970 items = append(items, p.row("TABLE", p.Doc(node.Table)))
1971 items = append(items, p.row("FROM", pretty.Nil))
1972 }
1973 items = append(items, p.row(node.FileFormat, p.Doc(&node.Files)))
1974 } else {
1975 if node.Into {
1976 into := p.Doc(node.Table)
1977 if node.IntoCols != nil {
1978 into = p.nestUnder(into, p.bracket("(", p.Doc(&node.IntoCols), ")"))
1979 }
1980 items = append(items, p.row("INTO", into))
1981 } else {
1982 if node.CreateFile != nil {
1983 items = append(items, p.row("TABLE", p.Doc(node.Table)))
1984 items = append(items, p.row("CREATE USING", p.Doc(node.CreateFile)))
1985 } else {
1986 table := p.bracketDoc(
1987 pretty.ConcatSpace(p.Doc(node.Table), pretty.Text("(")),
1988 p.Doc(&node.CreateDefs),
1989 pretty.Text(")"),
1990 )
1991 items = append(items, p.row("TABLE", table))
1992 }
1993 }
1994
1995 data := p.bracketKeyword(
1996 "DATA", " (",
1997 p.Doc(&node.Files),
1998 ")", "",
1999 )
2000 items = append(items, p.row(node.FileFormat, data))
2001 }
2002 if node.Options != nil {
2003 items = append(items, p.row("WITH", p.Doc(&node.Options)))
2004 }
2005 return p.rlTable(items...)
2006}
2007
2008func (node *Export) doc(p *PrettyCfg) pretty.Doc {
2009 items := make([]pretty.TableRow, 0, 5)

Callers

nothing calls this directly

Calls 9

ConcatSpaceFunction · 0.92
TextFunction · 0.92
rowMethod · 0.80
DocMethod · 0.80
nestUnderMethod · 0.80
bracketMethod · 0.80
bracketDocMethod · 0.80
bracketKeywordMethod · 0.80
rlTableMethod · 0.80

Tested by

no test coverage detected