MCPcopy
hub / github.com/chartbrew/chartbrew / runRequest

Method runRequest

server/controllers/DatasetController.js:328–786  ·  view source on GitHub ↗
({
    dataset_id,
    chart_id,
    noSource,
    getCache,
    filters,
    timezone,
    variables = {},
    team_id,
    traceContext,
    projectId,
    teamId,
    runtimeContext,
    viewerScope = "shared",
    readRuntimeSourceCache = false,
    writeRuntimeSourceCache = false,
  })

Source from the content-addressed store, hash-verified

326 }
327
328 runRequest({
329 dataset_id,
330 chart_id,
331 noSource,
332 getCache,
333 filters,
334 timezone,
335 variables = {},
336 team_id,
337 traceContext,
338 projectId,
339 teamId,
340 runtimeContext,
341 viewerScope = "shared",
342 readRuntimeSourceCache = false,
343 writeRuntimeSourceCache = false,
344 }) {
345 let gDataset;
346 let mainDr;
347 let sourceCacheEntry;
348 let sourceCacheParams;
349 return db.Dataset.findOne({
350 where: { id: dataset_id, ...(team_id ? { team_id } : {}) },
351 include: [
352 {
353 model: db.DataRequest,
354 include: [
355 { model: db.Connection, attributes: ["id", "name", "type", "subType", "host", "updatedAt"] },
356 {
357 model: db.VariableBinding,
358 on: Sequelize.and(
359 { "$DataRequests->VariableBindings.entity_type$": "DataRequest" },
360 Sequelize.where(
361 Sequelize.cast(Sequelize.col("DataRequests->VariableBindings.entity_id"), "INTEGER"),
362 Sequelize.col("DataRequests.id")
363 )
364 ),
365 required: false
366 },
367 ]
368 },
369 {
370 model: db.VariableBinding,
371 on: Sequelize.and(
372 { "$VariableBindings.entity_type$": "Dataset" },
373 Sequelize.where(
374 Sequelize.cast(Sequelize.col("VariableBindings.entity_id"), "INTEGER"),
375 Sequelize.col("Dataset.id")
376 )
377 ),
378 required: false
379 },
380 ],
381 })
382 .then((dataset) => {
383 if (!dataset) {
384 return new Promise((resolve, reject) => reject(new Error(404)));
385 }

Callers

nothing calls this directly

Calls 15

startRunFunction · 0.85
applySourceVariablesFunction · 0.85
createHashFunction · 0.85
sanitizeQueryPreviewFunction · 0.85
sanitizeRouteSnippetFunction · 0.85
sanitizeHeaderNamesFunction · 0.85
sanitizeSnippetFunction · 0.85
startEventFunction · 0.85
finishEventFunction · 0.85
completeRunFunction · 0.85
runSourceDataRequestFunction · 0.85
failRunFunction · 0.85

Tested by

no test coverage detected