(chunks: SQLChunk[], separator?: SQLChunk)
| 526 | * ``` |
| 527 | */ |
| 528 | export function join(chunks: SQLChunk[], separator?: SQLChunk): SQL { |
| 529 | const result: SQLChunk[] = []; |
| 530 | for (const [i, chunk] of chunks.entries()) { |
| 531 | if (i > 0 && separator !== undefined) { |
| 532 | result.push(separator); |
| 533 | } |
| 534 | result.push(chunk); |
| 535 | } |
| 536 | return new SQL(result); |
| 537 | } |
| 538 | |
| 539 | /** |
| 540 | * Create a SQL chunk that represents a DB identifier (table, column, index etc.). |
no outgoing calls
no test coverage detected