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

Function firstSearchPathEntry

server/sqlcore/identifier.go:65–83  ·  view source on GitHub ↗
(searchPath string)

Source from the content-addressed store, hash-verified

63}
64
65func firstSearchPathEntry(searchPath string) string {
66 searchPath = strings.TrimSpace(searchPath)
67 inQuotes := false
68 for i := 0; i < len(searchPath); i++ {
69 ch := searchPath[i]
70 if ch == '"' {
71 if inQuotes && i+1 < len(searchPath) && searchPath[i+1] == '"' {
72 i++
73 continue
74 }
75 inQuotes = !inQuotes
76 continue
77 }
78 if ch == ',' && !inQuotes {
79 return strings.TrimSpace(searchPath[:i])
80 }
81 }
82 return searchPath
83}
84
85func parseIdentifierPart(s string) (string, bool) {
86 s = strings.TrimSpace(s)

Callers 1

CatalogFromSearchPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected