(searchPath string)
| 90 | } |
| 91 | |
| 92 | func splitPGSearchPath(searchPath string) []string { |
| 93 | var parts []string |
| 94 | start := 0 |
| 95 | var quote byte |
| 96 | |
| 97 | for i := 0; i < len(searchPath); i++ { |
| 98 | switch { |
| 99 | case quote != 0: |
| 100 | if searchPath[i] != quote { |
| 101 | continue |
| 102 | } |
| 103 | if i+1 < len(searchPath) && searchPath[i+1] == quote { |
| 104 | i++ |
| 105 | continue |
| 106 | } |
| 107 | quote = 0 |
| 108 | case searchPath[i] == '"' || searchPath[i] == '\'': |
| 109 | quote = searchPath[i] |
| 110 | case searchPath[i] == ',': |
| 111 | parts = append(parts, searchPath[start:i]) |
| 112 | start = i + 1 |
| 113 | default: |
| 114 | } |
| 115 | } |
| 116 | parts = append(parts, searchPath[start:]) |
| 117 | return parts |
| 118 | } |
| 119 | |
| 120 | // isPGSystemPath checks if a path is a PostgreSQL system schema. |
| 121 | func isPGSystemPath(path string) bool { |
no outgoing calls
no test coverage detected