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

Function deliver

apps/sim/lib/data-drains/destinations/bigquery.ts:314–329  ·  view source on GitHub ↗
({ body, metadata, signal })

Source from the content-addressed store, hash-verified

312 const jwt = buildJwt(account)
313 return {
314 async deliver({ body, metadata, signal }) {
315 const rows = parseNdjsonObjects(body, { requireObject: true }) as Record<string, unknown>[]
316 if (rows.length === 0) {
317 return {
318 locator: `bigquery://${config.projectId}/${config.datasetId}/${config.tableId}#${metadata.runId}-${metadata.sequence}`,
319 }
320 }
321 await insertAll({ config, rows, metadata, jwt, signal })
322 logger.debug('BigQuery chunk delivered', {
323 table: `${config.projectId}.${config.datasetId}.${config.tableId}`,
324 rows: rows.length,
325 })
326 return {
327 locator: `bigquery://${config.projectId}/${config.datasetId}/${config.tableId}#${metadata.runId}-${metadata.sequence}`,
328 }
329 },
330 async close() {},
331 }
332 },

Callers

nothing calls this directly

Calls 3

parseNdjsonObjectsFunction · 0.90
insertAllFunction · 0.85
debugMethod · 0.80

Tested by

no test coverage detected