()
| 49 | Object.keys(sb.joins).length ? join(sb.joins, ' ') : ''; |
| 50 | const getFill = () => (sb.fill ? `WITH FILL ${sb.fill}` : ''); |
| 51 | const getWith = () => { |
| 52 | const cteEntries = Object.entries(sb.ctes); |
| 53 | if (cteEntries.length === 0) return ''; |
| 54 | const cteClauses = cteEntries.map( |
| 55 | ([name, query]) => `${name} AS (${query})`, |
| 56 | ); |
| 57 | return `WITH ${cteClauses.join(', ')} `; |
| 58 | }; |
| 59 | |
| 60 | return { |
| 61 | sb, |
no test coverage detected