MCPcopy Create free account
hub / github.com/bytebase/bytebase / ParsePGConfiguredSearchPath

Function ParsePGConfiguredSearchPath

backend/store/model/pg_search_path.go:13–27  ·  view source on GitHub ↗

ParsePGConfiguredSearchPath parses a PostgreSQL search_path setting while preserving non-system configured entries, including the special $user placeholder.

(searchPath string)

Source from the content-addressed store, hash-verified

11// ParsePGConfiguredSearchPath parses a PostgreSQL search_path setting while preserving
12// non-system configured entries, including the special $user placeholder.
13func ParsePGConfiguredSearchPath(searchPath string) []PGSearchPathItem {
14 if searchPath == "" {
15 return []PGSearchPathItem{}
16 }
17
18 var result []PGSearchPathItem
19 for _, token := range splitPGSearchPath(searchPath) {
20 item, ok := parsePGSearchPathItem(token)
21 if !ok {
22 continue
23 }
24 result = append(result, item)
25 }
26 return result
27}
28
29// ResolvePGSearchPath resolves a parsed PostgreSQL search_path for a current user.
30// When schemaExists is provided, schemas missing from metadata are omitted.

Callers 2

NewDatabaseMetadataFunction · 0.85

Calls 2

splitPGSearchPathFunction · 0.85
parsePGSearchPathItemFunction · 0.85

Tested by 1