(path: string, taken: Set<string>)
| 28 | * path slug; on collision, appends `_0`, `_1`, … |
| 29 | */ |
| 30 | export function deriveOutputColumnName(path: string, taken: Set<string>): string { |
| 31 | const base = slugifyColumnName(path) |
| 32 | if (!taken.has(base)) return base |
| 33 | for (let i = 0; i < 1000; i++) { |
| 34 | const candidate = `${base}_${i}` |
| 35 | if (!taken.has(candidate)) return candidate |
| 36 | } |
| 37 | return `${base}_${Date.now()}` |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Map a block-output leaf type onto a table column type. Block schemas use |
no test coverage detected