({
dataset_id,
chart_id,
noSource,
getCache,
filters,
timezone,
variables = {},
team_id,
traceContext,
projectId,
teamId,
runtimeContext,
viewerScope = "shared",
readRuntimeSourceCache = false,
writeRuntimeSourceCache = false,
})
| 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 | } |
nothing calls this directly
no test coverage detected