(
queryId: Id,
tableIdOrAsQuery: Id | true,
tableIdOrBuild: Id | Build,
buildOrParamValues?: Build | ParamValues,
paramValuesIfSourceIsQuery: ParamValues = {},
)
| 328 | }; |
| 329 | |
| 330 | const setQueryDefinition = ( |
| 331 | queryId: Id, |
| 332 | tableIdOrAsQuery: Id | true, |
| 333 | tableIdOrBuild: Id | Build, |
| 334 | buildOrParamValues?: Build | ParamValues, |
| 335 | paramValuesIfSourceIsQuery: ParamValues = {}, |
| 336 | ): Queries => { |
| 337 | const [tableId, build, sourceIsQuery, paramValues] = isTrue( |
| 338 | tableIdOrAsQuery, |
| 339 | ) |
| 340 | ? [ |
| 341 | tableIdOrBuild as Id, |
| 342 | buildOrParamValues as Build, |
| 343 | 1 as const, |
| 344 | paramValuesIfSourceIsQuery, |
| 345 | ] |
| 346 | : [ |
| 347 | tableIdOrAsQuery, |
| 348 | tableIdOrBuild as Build, |
| 349 | 0 as const, |
| 350 | (buildOrParamValues as ParamValues | undefined) ?? {}, |
| 351 | ]; |
| 352 | ifNotUndefined(getQueryArgs(queryId), ([, listenerId]) => |
| 353 | paramStore.delListener(listenerId), |
| 354 | ); |
| 355 | setDefinition(queryId, tableId); |
| 356 | setQueryArgs(queryId, [ |
| 357 | build, |
| 358 | paramStore.addRowListener(PARAMS_TABLE, queryId, () => |
| 359 | setQueryDefinitionImpl(queryId), |
| 360 | ), |
| 361 | sourceIsQuery, |
| 362 | ]); |
| 363 | setOrDelParamValues(queryId, paramValues); |
| 364 | setQueryDefinitionImpl(queryId); |
| 365 | return queries; |
| 366 | }; |
| 367 | |
| 368 | const setQueryDefinitionImpl = (queryId: Id): Queries => |
| 369 | getResultStore(queryId).transaction( |
nothing calls this directly
no test coverage detected
searching dependent graphs…