MCPcopy Create free account
hub / github.com/simstudioai/sim / getTableJob

Function getTableJob

apps/sim/lib/table/jobs/service.ts:298–313  ·  view source on GitHub ↗
(
  tableId: string,
  jobId: string
)

Source from the content-addressed store, hash-verified

296
297/** Reads one job row (type/status/payload) scoped to its table. Null when absent. */
298export async function getTableJob(
299 tableId: string,
300 jobId: string
301): Promise<{ id: string; type: string; status: string; payload: unknown } | null> {
302 const [job] = await db
303 .select({
304 id: tableJobs.id,
305 type: tableJobs.type,
306 status: tableJobs.status,
307 payload: tableJobs.payload,
308 })
309 .from(tableJobs)
310 .where(and(eq(tableJobs.id, jobId), eq(tableJobs.tableId, tableId)))
311 .limit(1)
312 return job ?? null
313}
314
315/**
316 * Stamps an export job's generated-file storage key onto its payload (`{ resultKey }` merge).

Callers 2

route.tsFile · 0.90
route.tsFile · 0.90

Calls 1

eqFunction · 0.50

Tested by

no test coverage detected