expandNode recursively expands * in all parts of the statement
(ctx context.Context, node ast.Node)
| 71 | |
| 72 | // expandNode recursively expands * in all parts of the statement |
| 73 | func (e *Expander) expandNode(ctx context.Context, node ast.Node) error { |
| 74 | if node == nil { |
| 75 | return nil |
| 76 | } |
| 77 | |
| 78 | switch n := node.(type) { |
| 79 | case *ast.SelectStmt: |
| 80 | return e.expandSelectStmt(ctx, n) |
| 81 | case *ast.InsertStmt: |
| 82 | return e.expandInsertStmt(ctx, n) |
| 83 | case *ast.UpdateStmt: |
| 84 | return e.expandUpdateStmt(ctx, n) |
| 85 | case *ast.DeleteStmt: |
| 86 | return e.expandDeleteStmt(ctx, n) |
| 87 | case *ast.CommonTableExpr: |
| 88 | return e.expandNode(ctx, n.Ctequery) |
| 89 | } |
| 90 | return nil |
| 91 | } |
| 92 | |
| 93 | // expandSelectStmt expands * in a SELECT statement including CTEs and subqueries |
| 94 | func (e *Expander) expandSelectStmt(ctx context.Context, stmt *ast.SelectStmt) error { |
no test coverage detected