ParsePGConfiguredSearchPath parses a PostgreSQL search_path setting while preserving non-system configured entries, including the special $user placeholder.
(searchPath string)
| 11 | // ParsePGConfiguredSearchPath parses a PostgreSQL search_path setting while preserving |
| 12 | // non-system configured entries, including the special $user placeholder. |
| 13 | func 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. |