| 2449 | } |
| 2450 | |
| 2451 | func (node *CursorStmt) doc(p *PrettyCfg) pretty.Doc { |
| 2452 | ret := pretty.Nil |
| 2453 | fetchType := node.FetchType.String() |
| 2454 | if fetchType != "" { |
| 2455 | ret = pretty.ConcatSpace(ret, pretty.Keyword(fetchType)) |
| 2456 | } |
| 2457 | if node.FetchType.HasCount() { |
| 2458 | ret = pretty.ConcatSpace(ret, pretty.Text(strconv.Itoa(int(node.Count)))) |
| 2459 | } |
| 2460 | return pretty.Fold(pretty.ConcatSpace, |
| 2461 | ret, |
| 2462 | pretty.Keyword("FROM"), |
| 2463 | p.Doc(&node.Name), |
| 2464 | ) |
| 2465 | } |
| 2466 | |
| 2467 | func (node *FetchCursor) doc(p *PrettyCfg) pretty.Doc { |
| 2468 | return pretty.ConcatSpace(pretty.Keyword("FETCH"), node.CursorStmt.doc(p)) |