(value: string)
| 269 | |
| 270 | /** @internal */ |
| 271 | export function normalizePartitionDefinition(value: string): string { |
| 272 | const normalized = normalizeWhitespace(value); |
| 273 | const match = /^(\w+)\s*(.*)$/.exec(normalized); |
| 274 | const rawType = match ? match[1] : normalized; |
| 275 | const type = rawType.toLowerCase(); |
| 276 | const expression = match ? match[2].trim() : ''; |
| 277 | |
| 278 | if (!expression) { |
| 279 | return type; |
| 280 | } |
| 281 | |
| 282 | if (!expression.startsWith('(')) { |
| 283 | return `${type} ${normalizePartitionSqlFragment(expression)}`; |
| 284 | } |
| 285 | |
| 286 | return `${type} (${normalizePartitionSqlFragment(unwrapAllOuterParentheses(expression))})`; |
| 287 | } |
| 288 | |
| 289 | const PARTITION_BOUND_KEYWORDS = /\b(for values|with|in|from|to|minvalue|maxvalue|null)\b/gi; |
| 290 |
no test coverage detected