Executor that returns the queued result arrays in the order queries are issued.
(results: unknown[][])
| 11 | |
| 12 | /** Executor that returns the queued result arrays in the order queries are issued. */ |
| 13 | function queuedExecutor(results: unknown[][]): DbOrTx { |
| 14 | let index = 0 |
| 15 | const builder = { |
| 16 | from: () => builder, |
| 17 | innerJoin: () => builder, |
| 18 | where: () => Promise.resolve(results[index++] ?? []), |
| 19 | } |
| 20 | return { select: () => builder } as unknown as DbOrTx |
| 21 | } |
| 22 | |
| 23 | function ref(kind: ForkReference['kind'], sourceId: string): ForkReference { |
| 24 | return { kind, sourceId, subBlockKey: 'tools', required: false } |