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

Method doc

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

Source from the content-addressed store, hash-verified

1212}
1213
1214func (node *Order) doc(p *PrettyCfg) pretty.Doc {
1215 var d pretty.Doc
1216 if node.OrderType == OrderByColumn {
1217 d = p.Doc(node.Expr)
1218 } else {
1219 if node.Index == "" {
1220 d = pretty.ConcatSpace(
1221 pretty.Keyword("PRIMARY KEY"),
1222 p.Doc(&node.Table),
1223 )
1224 } else {
1225 d = pretty.ConcatSpace(
1226 pretty.Keyword("INDEX"),
1227 pretty.Fold(pretty.Concat,
1228 p.Doc(&node.Table),
1229 pretty.Text("@"),
1230 p.Doc(&node.Index),
1231 ),
1232 )
1233 }
1234 }
1235 if node.Direction != DefaultDirection {
1236 d = p.nestUnder(d, pretty.Text(node.Direction.String()))
1237 }
1238 if node.NullsOrder != DefaultNullsOrder {
1239 d = p.nestUnder(d, pretty.Text(node.NullsOrder.String()))
1240 }
1241 return d
1242}
1243
1244func (node *UpdateExpr) doc(p *PrettyCfg) pretty.Doc {
1245 d := p.Doc(&node.Names)

Callers

nothing calls this directly

Calls 7

ConcatSpaceFunction · 0.92
KeywordFunction · 0.92
FoldFunction · 0.92
TextFunction · 0.92
DocMethod · 0.80
nestUnderMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected