expandFromClause expands * in subqueries within FROM clause
(ctx context.Context, node ast.Node)
| 288 | |
| 289 | // expandFromClause expands * in subqueries within FROM clause |
| 290 | func (e *Expander) expandFromClause(ctx context.Context, node ast.Node) error { |
| 291 | if node == nil { |
| 292 | return nil |
| 293 | } |
| 294 | |
| 295 | switch n := node.(type) { |
| 296 | case *ast.RangeSubselect: |
| 297 | if n.Subquery != nil { |
| 298 | return e.expandNode(ctx, n.Subquery) |
| 299 | } |
| 300 | case *ast.JoinExpr: |
| 301 | if err := e.expandFromClause(ctx, n.Larg); err != nil { |
| 302 | return err |
| 303 | } |
| 304 | if err := e.expandFromClause(ctx, n.Rarg); err != nil { |
| 305 | return err |
| 306 | } |
| 307 | } |
| 308 | return nil |
| 309 | } |
| 310 | |
| 311 | // hasStarAnywhere checks if there's a * anywhere in the statement using astutils.Search |
| 312 | func hasStarAnywhere(node ast.Node) bool { |
no test coverage detected