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

Method docTable

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

Source from the content-addressed store, hash-verified

2423}
2424
2425func (node *DeclareCursor) docTable(p *PrettyCfg) []pretty.TableRow {
2426 optionsRow := pretty.Nil
2427 if node.Binary {
2428 optionsRow = pretty.ConcatSpace(optionsRow, pretty.Keyword("BINARY"))
2429 }
2430 if node.Sensitivity != UnspecifiedSensitivity {
2431 optionsRow = pretty.ConcatSpace(optionsRow, pretty.Keyword(node.Sensitivity.String()))
2432 }
2433 if node.Scroll != UnspecifiedScroll {
2434 optionsRow = pretty.ConcatSpace(optionsRow, pretty.Keyword(node.Scroll.String()))
2435 }
2436 cursorRow := pretty.Nil
2437 if node.Hold {
2438 cursorRow = pretty.ConcatSpace(cursorRow, pretty.Keyword("WITH HOLD"))
2439 }
2440 return []pretty.TableRow{
2441 p.row("DECLARE", pretty.ConcatLine(p.Doc(&node.Name), optionsRow)),
2442 p.row("CURSOR", cursorRow),
2443 p.row("FOR", node.Select.doc(p)),
2444 }
2445}
2446
2447func (node *DeclareCursor) doc(p *PrettyCfg) pretty.Doc {
2448 return p.rlTable(node.docTable(p)...)

Callers 1

docMethod · 0.95

Calls 7

ConcatSpaceFunction · 0.92
KeywordFunction · 0.92
ConcatLineFunction · 0.92
rowMethod · 0.80
DocMethod · 0.80
StringMethod · 0.65
docMethod · 0.65

Tested by

no test coverage detected