MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / hasStarInList

Function hasStarInList

internal/x/expander/expander.go:325–335  ·  view source on GitHub ↗

hasStarInList checks if a target list contains a * expression using astutils.Search

(targets *ast.List)

Source from the content-addressed store, hash-verified

323
324// hasStarInList checks if a target list contains a * expression using astutils.Search
325func hasStarInList(targets *ast.List) bool {
326 if targets == nil {
327 return false
328 }
329 // Use astutils.Search to find any A_Star node in the target list
330 stars := astutils.Search(targets, func(n ast.Node) bool {
331 _, ok := n.(*ast.A_Star)
332 return ok
333 })
334 return len(stars.Items) > 0
335}
336
337// getColumnNames prepares the query and returns the column names from the result
338func (e *Expander) getColumnNames(ctx context.Context, query string) ([]string, error) {

Callers 4

expandSelectStmtMethod · 0.85
expandInsertStmtMethod · 0.85
expandUpdateStmtMethod · 0.85
expandDeleteStmtMethod · 0.85

Calls 1

SearchFunction · 0.92

Tested by

no test coverage detected