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

Function CatalogFromSearchPath

server/sqlcore/identifier.go:49–59  ·  view source on GitHub ↗

CatalogFromSearchPath returns the catalog from the first search_path entry, or "" when the first entry is an unqualified schema.

(searchPath string)

Source from the content-addressed store, hash-verified

47// CatalogFromSearchPath returns the catalog from the first search_path entry,
48// or "" when the first entry is an unqualified schema.
49func CatalogFromSearchPath(searchPath string) string {
50 entry := firstSearchPathEntry(searchPath)
51 if entry == "" {
52 return ""
53 }
54 parts, ok := ParseQualifiedIdentifier(entry)
55 if !ok || len(parts) < 2 {
56 return ""
57 }
58 return parts[0]
59}
60
61func QuoteIdentifier(s string) string {
62 return `"` + strings.ReplaceAll(s, `"`, `""`) + `"`

Callers 1

Calls 2

firstSearchPathEntryFunction · 0.85
ParseQualifiedIdentifierFunction · 0.85

Tested by 1