(name: string)
| 182 | * double-quoted identifiers are part of the identifier and do not split. |
| 183 | */ |
| 184 | const splitPartitionName = (name: string): { name: string; schema?: string } => { |
| 185 | let depth = 0; |
| 186 | |
| 187 | for (let i = 0; i < name.length; i++) { |
| 188 | const ch = name[i]; |
| 189 | |
| 190 | if (ch === '"') { |
| 191 | if (name[i + 1] === '"') { |
| 192 | i++; |
| 193 | continue; |
| 194 | } |
| 195 | |
| 196 | depth = depth === 0 ? 1 : 0; |
| 197 | continue; |
| 198 | } |
| 199 | |
| 200 | if (ch === '.' && depth === 0) { |
| 201 | return { |
| 202 | schema: unquoteIdentifier(name.slice(0, i)), |
| 203 | name: unquoteIdentifier(name.slice(i + 1)), |
| 204 | }; |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | return { name: unquoteIdentifier(name) }; |
| 209 | }; |
| 210 | |
| 211 | const resolvePartitionKey = (meta: EntityMetadata, key: string, quoteIdentifier: (id: string) => string): string => { |
| 212 | const trimmed = key.trim().replaceAll('"', ''); |
no test coverage detected