MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / columnMatches

Function columnMatches

pkg/transform/columns.go:114–127  ·  view source on GitHub ↗

columnMatches checks if a column expression matches the given name.

(expr ast.Expression, name string)

Source from the content-addressed store, hash-verified

112
113// columnMatches checks if a column expression matches the given name.
114func columnMatches(expr ast.Expression, name string) bool {
115 lower := strings.ToLower(name)
116 switch e := expr.(type) {
117 case *ast.Identifier:
118 return strings.ToLower(e.Name) == lower
119 case *ast.AliasedExpression:
120 if strings.ToLower(e.Alias) == lower {
121 return true
122 }
123 return columnMatches(e.Expr, name)
124 default:
125 return false
126 }
127}

Callers 2

RemoveColumnFunction · 0.85
ReplaceColumnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected