MCPcopy Create free account
hub / github.com/PostHog/duckgres / isVersionCall

Method isVersionCall

transpiler/transform/version.go:196–208  ·  view source on GitHub ↗

isVersionCall checks if a FuncCall is version() or pg_catalog.version()

(fc *pg_query.FuncCall)

Source from the content-addressed store, hash-verified

194
195// isVersionCall checks if a FuncCall is version() or pg_catalog.version()
196func (t *VersionTransform) isVersionCall(fc *pg_query.FuncCall) bool {
197 if fc == nil || len(fc.Funcname) == 0 || len(fc.Args) != 0 {
198 return false
199 }
200 // Check the last part of the function name (handles both version() and pg_catalog.version())
201 last := fc.Funcname[len(fc.Funcname)-1]
202 if last != nil {
203 if str := last.GetString_(); str != nil {
204 return strings.EqualFold(str.Sval, "version")
205 }
206 }
207 return false
208}

Callers 1

walkAndTransformMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected