MCPcopy
hub / github.com/sqlc-dev/sqlc / expandNode

Method expandNode

internal/x/expander/expander.go:73–91  ·  view source on GitHub ↗

expandNode recursively expands * in all parts of the statement

(ctx context.Context, node ast.Node)

Source from the content-addressed store, hash-verified

71
72// expandNode recursively expands * in all parts of the statement
73func (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
94func (e *Expander) expandSelectStmt(ctx context.Context, stmt *ast.SelectStmt) error {

Callers 5

ExpandMethod · 0.95
expandInsertStmtMethod · 0.95
expandUpdateStmtMethod · 0.95
expandDeleteStmtMethod · 0.95
expandFromClauseMethod · 0.95

Calls 4

expandSelectStmtMethod · 0.95
expandInsertStmtMethod · 0.95
expandUpdateStmtMethod · 0.95
expandDeleteStmtMethod · 0.95

Tested by

no test coverage detected