MCPcopy Index your code
hub / github.com/simstudioai/sim / selectCompletedExecPage

Function selectCompletedExecPage

apps/sim/lib/table/backfill-runner.ts:72–94  ·  view source on GitHub ↗

One keyset page of completed (rowId, executionId) pairs for the group, ordered by rowId.

(
  tableId: string,
  groupId: string,
  afterRowId: string | undefined,
  limit: number
)

Source from the content-addressed store, hash-verified

70
71/** One keyset page of completed (rowId, executionId) pairs for the group, ordered by rowId. */
72async 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

Callers 2

runTableBackfillFunction · 0.85

Calls 1

eqFunction · 0.50

Tested by

no test coverage detected