nodeWith handles *tree.With nodes.
(ctx *Context, node *tree.With)
| 60 | |
| 61 | // nodeWith handles *tree.With nodes. |
| 62 | func nodeWith(ctx *Context, node *tree.With) (*vitess.With, error) { |
| 63 | if node == nil { |
| 64 | return nil, nil |
| 65 | } |
| 66 | |
| 67 | ctes := make([]*vitess.CommonTableExpr, len(node.CTEList)) |
| 68 | for i, cte := range node.CTEList { |
| 69 | var err error |
| 70 | ctes[i], err = nodeCTE(ctx, cte) |
| 71 | if err != nil { |
| 72 | return nil, err |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | return &vitess.With{ |
| 77 | Recursive: node.Recursive, |
| 78 | Ctes: ctes, |
| 79 | }, nil |
| 80 | } |
no test coverage detected