@finos/legend-query-builder 4.16.51 → 4.16.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/shared/LambdaEditor.d.ts +1 -0
- package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaEditor.js +25 -26
- package/lib/components/shared/LambdaEditor.js.map +1 -1
- package/lib/index.css +0 -16
- package/lib/package.json +1 -1
- package/lib/stores/QueryBuilderExecutionContextState.d.ts +5 -1
- package/lib/stores/QueryBuilderExecutionContextState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderExecutionContextState.js +16 -4
- package/lib/stores/QueryBuilderExecutionContextState.js.map +1 -1
- package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderResultState.js +8 -19
- package/lib/stores/QueryBuilderResultState.js.map +1 -1
- package/lib/stores/QueryBuilderState.d.ts +1 -0
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +10 -6
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/package.json +2 -2
- package/src/components/shared/LambdaEditor.tsx +40 -37
- package/src/stores/QueryBuilderExecutionContextState.ts +21 -5
- package/src/stores/QueryBuilderResultState.ts +12 -25
- package/src/stores/QueryBuilderState.ts +17 -8
@@ -54,7 +54,6 @@ import type { DataGridColumnState } from '@finos/legend-lego/data-grid';
|
|
54
54
|
import { downloadStream } from '@finos/legend-application';
|
55
55
|
import { QueryBuilderDataGridCustomAggregationFunction } from '../components/result/tds/QueryBuilderTDSGridResult.js';
|
56
56
|
import { QueryBuilderTDSState } from './fetch-structure/tds/QueryBuilderTDSState.js';
|
57
|
-
import { QueryBuilderEmbeddedFromExecutionContextState } from './QueryBuilderExecutionContextState.js';
|
58
57
|
|
59
58
|
export const DEFAULT_LIMIT = 1000;
|
60
59
|
|
@@ -409,8 +408,8 @@ export class QueryBuilderResultState {
|
|
409
408
|
const result =
|
410
409
|
(yield this.queryBuilderState.graphManagerState.graphManager.exportData(
|
411
410
|
query,
|
412
|
-
this.queryBuilderState.executionContextState.
|
413
|
-
this.queryBuilderState.executionContextState.
|
411
|
+
this.queryBuilderState.executionContextState.explicitMappingValue,
|
412
|
+
this.queryBuilderState.executionContextState.explicitRuntimeValue,
|
414
413
|
this.queryBuilderState.graphManagerState.graph,
|
415
414
|
{
|
416
415
|
serializationFormat,
|
@@ -476,11 +475,11 @@ export class QueryBuilderResultState {
|
|
476
475
|
try {
|
477
476
|
this.setIsRunningQuery(true);
|
478
477
|
const currentHashCode = this.queryBuilderState.hashCode;
|
479
|
-
|
478
|
+
guaranteeNonNullable(
|
480
479
|
this.queryBuilderState.executionContextState.mapping,
|
481
480
|
'Mapping is required to execute query',
|
482
481
|
);
|
483
|
-
|
482
|
+
guaranteeNonNullable(
|
484
483
|
this.queryBuilderState.executionContextState.runtimeValue,
|
485
484
|
`Runtime is required to execute query`,
|
486
485
|
);
|
@@ -503,12 +502,8 @@ export class QueryBuilderResultState {
|
|
503
502
|
const contextstate = this.queryBuilderState.executionContextState;
|
504
503
|
promise = this.queryBuilderState.graphManagerState.graphManager.runQuery(
|
505
504
|
query,
|
506
|
-
contextstate
|
507
|
-
|
508
|
-
: mapping,
|
509
|
-
contextstate instanceof QueryBuilderEmbeddedFromExecutionContextState
|
510
|
-
? undefined
|
511
|
-
: runtime,
|
505
|
+
contextstate.explicitMappingValue,
|
506
|
+
contextstate.explicitRuntimeValue,
|
512
507
|
this.queryBuilderState.graphManagerState.graph,
|
513
508
|
{
|
514
509
|
parameterValues,
|
@@ -584,11 +579,11 @@ export class QueryBuilderResultState {
|
|
584
579
|
*generatePlan(debug: boolean): GeneratorFn<void> {
|
585
580
|
try {
|
586
581
|
this.isGeneratingPlan = true;
|
587
|
-
|
582
|
+
guaranteeNonNullable(
|
588
583
|
this.queryBuilderState.executionContextState.mapping,
|
589
584
|
'Mapping is required to execute query',
|
590
585
|
);
|
591
|
-
|
586
|
+
guaranteeNonNullable(
|
592
587
|
this.queryBuilderState.executionContextState.runtimeValue,
|
593
588
|
`Runtime is required to execute query`,
|
594
589
|
);
|
@@ -600,14 +595,6 @@ export class QueryBuilderResultState {
|
|
600
595
|
this.queryBuilderState.graphManagerState.graph,
|
601
596
|
);
|
602
597
|
const contextstate = this.queryBuilderState.executionContextState;
|
603
|
-
const _mapping =
|
604
|
-
contextstate instanceof QueryBuilderEmbeddedFromExecutionContextState
|
605
|
-
? undefined
|
606
|
-
: mapping;
|
607
|
-
const _runtime =
|
608
|
-
contextstate instanceof QueryBuilderEmbeddedFromExecutionContextState
|
609
|
-
? undefined
|
610
|
-
: runtime;
|
611
598
|
if (debug) {
|
612
599
|
QueryBuilderTelemetryHelper.logEvent_ExecutionPlanDebugLaunched(
|
613
600
|
this.queryBuilderState.applicationStore.telemetryService,
|
@@ -615,8 +602,8 @@ export class QueryBuilderResultState {
|
|
615
602
|
const debugResult =
|
616
603
|
(yield this.queryBuilderState.graphManagerState.graphManager.debugExecutionPlanGeneration(
|
617
604
|
query,
|
618
|
-
|
619
|
-
|
605
|
+
contextstate.explicitMappingValue,
|
606
|
+
contextstate.explicitRuntimeValue,
|
620
607
|
this.queryBuilderState.graphManagerState.graph,
|
621
608
|
report,
|
622
609
|
)) as { plan: RawExecutionPlan; debug: string };
|
@@ -629,8 +616,8 @@ export class QueryBuilderResultState {
|
|
629
616
|
rawPlan =
|
630
617
|
(yield this.queryBuilderState.graphManagerState.graphManager.generateExecutionPlan(
|
631
618
|
query,
|
632
|
-
|
633
|
-
|
619
|
+
contextstate.explicitMappingValue,
|
620
|
+
contextstate.explicitRuntimeValue,
|
634
621
|
this.queryBuilderState.graphManagerState.graph,
|
635
622
|
report,
|
636
623
|
)) as object;
|
@@ -244,6 +244,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
244
244
|
setGetAllFunction: action,
|
245
245
|
setLambdaWriteMode: action,
|
246
246
|
setINTERNAL__enableInitializingDefaultSimpleExpressionValue: action,
|
247
|
+
TEMPORARY_initializeExecContext: action,
|
247
248
|
|
248
249
|
resetQueryResult: action,
|
249
250
|
resetQueryContent: action,
|
@@ -259,14 +260,9 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
259
260
|
|
260
261
|
this.applicationStore = applicationStore;
|
261
262
|
this.graphManagerState = graphManagerState;
|
262
|
-
this.executionContextState =
|
263
|
-
|
264
|
-
|
265
|
-
if (config?.enableTypedTDS) {
|
266
|
-
this.setLambdaWriteMode(
|
267
|
-
QUERY_BUILDER_LAMBDA_WRITER_MODE.TYPED_FETCH_STRUCTURE,
|
268
|
-
);
|
269
|
-
}
|
263
|
+
this.executionContextState = this.TEMPORARY_initializeExecContext(
|
264
|
+
Boolean(config?.enableTypedTDS),
|
265
|
+
);
|
270
266
|
this.milestoningState = new QueryBuilderMilestoningState(this);
|
271
267
|
this.explorerState = new QueryBuilderExplorerState(this);
|
272
268
|
this.parametersState = new QueryBuilderParametersState(this);
|
@@ -296,6 +292,19 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
296
292
|
false;
|
297
293
|
}
|
298
294
|
|
295
|
+
TEMPORARY_initializeExecContext(
|
296
|
+
isTypedTDS: boolean,
|
297
|
+
): QueryBuilderExecutionContextState {
|
298
|
+
if (isTypedTDS) {
|
299
|
+
const context = new QueryBuilderEmbeddedFromExecutionContextState(this);
|
300
|
+
this.setLambdaWriteMode(
|
301
|
+
QUERY_BUILDER_LAMBDA_WRITER_MODE.TYPED_FETCH_STRUCTURE,
|
302
|
+
);
|
303
|
+
return context;
|
304
|
+
}
|
305
|
+
return new QueryBuilderExternalExecutionContextState(this);
|
306
|
+
}
|
307
|
+
|
299
308
|
get isMappingReadOnly(): boolean {
|
300
309
|
return false;
|
301
310
|
}
|