One keyset page of completed (rowId, executionId) pairs for the group, ordered by rowId.
( tableId: string, groupId: string, afterRowId: string | undefined, limit: number )
| 70 | |
| 71 | /** One keyset page of completed (rowId, executionId) pairs for the group, ordered by rowId. */ |
| 72 | async function selectCompletedExecPage( |
| 73 | tableId: string, |
| 74 | groupId: string, |
| 75 | afterRowId: string | undefined, |
| 76 | limit: number |
| 77 | ): Promise<Array<{ rowId: string; executionId: string | null }>> { |
| 78 | return db |
| 79 | .select({ |
| 80 | rowId: tableRowExecutions.rowId, |
| 81 | executionId: tableRowExecutions.executionId, |
| 82 | }) |
| 83 | .from(tableRowExecutions) |
| 84 | .where( |
| 85 | and( |
| 86 | eq(tableRowExecutions.tableId, tableId), |
| 87 | eq(tableRowExecutions.groupId, groupId), |
| 88 | eq(tableRowExecutions.status, 'completed'), |
| 89 | afterRowId ? gt(tableRowExecutions.rowId, afterRowId) : undefined |
| 90 | ) |
| 91 | ) |
| 92 | .orderBy(asc(tableRowExecutions.rowId)) |
| 93 | .limit(limit) |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Backfills one page of rows: pulls each target output's value out of the rows' saved trace |
no test coverage detected