@malloydata/malloy-query-builder 0.0.240-dev250311202829 → 0.0.240-dev250311214430
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/README.md +4 -4
- package/dist/query-ast.d.ts +60 -29
- package/dist/query-ast.js +197 -99
- package/dist/query-ast.js.map +1 -1
- package/dist/query-ast.spec.js +280 -74
- package/dist/query-ast.spec.js.map +1 -1
- package/flow/query-ast.d.ts +62 -24
- package/package.json +4 -4
- package/src/query-ast.spec.ts +280 -74
- package/src/query-ast.ts +249 -111
package/src/query-ast.spec.ts
CHANGED
|
@@ -37,7 +37,10 @@ describe('query builder', () => {
|
|
|
37
37
|
const from: Malloy.Query = {
|
|
38
38
|
definition: {
|
|
39
39
|
kind: 'arrow',
|
|
40
|
-
|
|
40
|
+
source: {
|
|
41
|
+
kind: 'source_reference',
|
|
42
|
+
name: 'flights',
|
|
43
|
+
},
|
|
41
44
|
view: {
|
|
42
45
|
kind: 'segment',
|
|
43
46
|
operations: [
|
|
@@ -62,7 +65,10 @@ describe('query builder', () => {
|
|
|
62
65
|
to: {
|
|
63
66
|
definition: {
|
|
64
67
|
kind: 'arrow',
|
|
65
|
-
|
|
68
|
+
source: {
|
|
69
|
+
kind: 'source_reference',
|
|
70
|
+
name: 'flights',
|
|
71
|
+
},
|
|
66
72
|
view: {
|
|
67
73
|
kind: 'segment',
|
|
68
74
|
operations: [
|
|
@@ -96,7 +102,10 @@ describe('query builder', () => {
|
|
|
96
102
|
const from: Malloy.Query = {
|
|
97
103
|
definition: {
|
|
98
104
|
kind: 'arrow',
|
|
99
|
-
|
|
105
|
+
source: {
|
|
106
|
+
kind: 'source_reference',
|
|
107
|
+
name: 'flights',
|
|
108
|
+
},
|
|
100
109
|
view: {
|
|
101
110
|
kind: 'segment',
|
|
102
111
|
operations: [],
|
|
@@ -111,7 +120,10 @@ describe('query builder', () => {
|
|
|
111
120
|
to: {
|
|
112
121
|
definition: {
|
|
113
122
|
kind: 'arrow',
|
|
114
|
-
|
|
123
|
+
source: {
|
|
124
|
+
kind: 'source_reference',
|
|
125
|
+
name: 'flights',
|
|
126
|
+
},
|
|
115
127
|
view: {
|
|
116
128
|
kind: 'segment',
|
|
117
129
|
operations: [
|
|
@@ -135,7 +147,10 @@ describe('query builder', () => {
|
|
|
135
147
|
const from: Malloy.Query = {
|
|
136
148
|
definition: {
|
|
137
149
|
kind: 'arrow',
|
|
138
|
-
|
|
150
|
+
source: {
|
|
151
|
+
kind: 'source_reference',
|
|
152
|
+
name: 'flights',
|
|
153
|
+
},
|
|
139
154
|
view: {
|
|
140
155
|
kind: 'segment',
|
|
141
156
|
operations: [],
|
|
@@ -151,7 +166,10 @@ describe('query builder', () => {
|
|
|
151
166
|
to: {
|
|
152
167
|
definition: {
|
|
153
168
|
kind: 'arrow',
|
|
154
|
-
|
|
169
|
+
source: {
|
|
170
|
+
kind: 'source_reference',
|
|
171
|
+
name: 'flights',
|
|
172
|
+
},
|
|
155
173
|
view: {
|
|
156
174
|
kind: 'segment',
|
|
157
175
|
operations: [
|
|
@@ -191,7 +209,10 @@ describe('query builder', () => {
|
|
|
191
209
|
const from: Malloy.Query = {
|
|
192
210
|
definition: {
|
|
193
211
|
kind: 'arrow',
|
|
194
|
-
|
|
212
|
+
source: {
|
|
213
|
+
kind: 'source_reference',
|
|
214
|
+
name: 'flights',
|
|
215
|
+
},
|
|
195
216
|
view: {
|
|
196
217
|
kind: 'segment',
|
|
197
218
|
operations: [],
|
|
@@ -208,7 +229,10 @@ describe('query builder', () => {
|
|
|
208
229
|
to: {
|
|
209
230
|
definition: {
|
|
210
231
|
kind: 'arrow',
|
|
211
|
-
|
|
232
|
+
source: {
|
|
233
|
+
kind: 'source_reference',
|
|
234
|
+
name: 'flights',
|
|
235
|
+
},
|
|
212
236
|
view: {
|
|
213
237
|
kind: 'segment',
|
|
214
238
|
operations: [
|
|
@@ -244,7 +268,10 @@ describe('query builder', () => {
|
|
|
244
268
|
const from: Malloy.Query = {
|
|
245
269
|
definition: {
|
|
246
270
|
kind: 'arrow',
|
|
247
|
-
|
|
271
|
+
source: {
|
|
272
|
+
kind: 'source_reference',
|
|
273
|
+
name: 'flights',
|
|
274
|
+
},
|
|
248
275
|
view: {
|
|
249
276
|
kind: 'segment',
|
|
250
277
|
operations: [],
|
|
@@ -264,7 +291,10 @@ describe('query builder', () => {
|
|
|
264
291
|
to: {
|
|
265
292
|
definition: {
|
|
266
293
|
kind: 'arrow',
|
|
267
|
-
|
|
294
|
+
source: {
|
|
295
|
+
kind: 'source_reference',
|
|
296
|
+
name: 'flights',
|
|
297
|
+
},
|
|
268
298
|
view: {
|
|
269
299
|
kind: 'segment',
|
|
270
300
|
operations: [
|
|
@@ -288,7 +318,10 @@ describe('query builder', () => {
|
|
|
288
318
|
const from: Malloy.Query = {
|
|
289
319
|
definition: {
|
|
290
320
|
kind: 'arrow',
|
|
291
|
-
|
|
321
|
+
source: {
|
|
322
|
+
kind: 'source_reference',
|
|
323
|
+
name: 'flights',
|
|
324
|
+
},
|
|
292
325
|
view: {
|
|
293
326
|
kind: 'segment',
|
|
294
327
|
operations: [],
|
|
@@ -305,7 +338,10 @@ describe('query builder', () => {
|
|
|
305
338
|
to: {
|
|
306
339
|
definition: {
|
|
307
340
|
kind: 'arrow',
|
|
308
|
-
|
|
341
|
+
source: {
|
|
342
|
+
kind: 'source_reference',
|
|
343
|
+
name: 'flights',
|
|
344
|
+
},
|
|
309
345
|
view: {
|
|
310
346
|
kind: 'segment',
|
|
311
347
|
operations: [
|
|
@@ -340,7 +376,10 @@ describe('query builder', () => {
|
|
|
340
376
|
const from: Malloy.Query = {
|
|
341
377
|
definition: {
|
|
342
378
|
kind: 'arrow',
|
|
343
|
-
|
|
379
|
+
source: {
|
|
380
|
+
kind: 'source_reference',
|
|
381
|
+
name: 'flights',
|
|
382
|
+
},
|
|
344
383
|
view: {
|
|
345
384
|
kind: 'segment',
|
|
346
385
|
operations: [],
|
|
@@ -355,7 +394,10 @@ describe('query builder', () => {
|
|
|
355
394
|
to: {
|
|
356
395
|
definition: {
|
|
357
396
|
kind: 'arrow',
|
|
358
|
-
|
|
397
|
+
source: {
|
|
398
|
+
kind: 'source_reference',
|
|
399
|
+
name: 'flights',
|
|
400
|
+
},
|
|
359
401
|
view: {
|
|
360
402
|
kind: 'segment',
|
|
361
403
|
operations: [
|
|
@@ -378,7 +420,10 @@ describe('query builder', () => {
|
|
|
378
420
|
const from: Malloy.Query = {
|
|
379
421
|
definition: {
|
|
380
422
|
kind: 'arrow',
|
|
381
|
-
|
|
423
|
+
source: {
|
|
424
|
+
kind: 'source_reference',
|
|
425
|
+
name: 'flights',
|
|
426
|
+
},
|
|
382
427
|
view: {
|
|
383
428
|
kind: 'segment',
|
|
384
429
|
operations: [],
|
|
@@ -388,7 +433,7 @@ describe('query builder', () => {
|
|
|
388
433
|
expect((q: ASTQuery) => {
|
|
389
434
|
q.getOrAddDefaultSegment().addWhere('carrier', {
|
|
390
435
|
kind: 'string',
|
|
391
|
-
|
|
436
|
+
parsed: {operator: '=', values: ['WN', 'AA']},
|
|
392
437
|
});
|
|
393
438
|
}).toModifyQuery({
|
|
394
439
|
model: flights_model,
|
|
@@ -396,7 +441,10 @@ describe('query builder', () => {
|
|
|
396
441
|
to: {
|
|
397
442
|
definition: {
|
|
398
443
|
kind: 'arrow',
|
|
399
|
-
|
|
444
|
+
source: {
|
|
445
|
+
kind: 'source_reference',
|
|
446
|
+
name: 'flights',
|
|
447
|
+
},
|
|
400
448
|
view: {
|
|
401
449
|
kind: 'segment',
|
|
402
450
|
operations: [
|
|
@@ -419,7 +467,10 @@ describe('query builder', () => {
|
|
|
419
467
|
const from: Malloy.Query = {
|
|
420
468
|
definition: {
|
|
421
469
|
kind: 'arrow',
|
|
422
|
-
|
|
470
|
+
source: {
|
|
471
|
+
kind: 'source_reference',
|
|
472
|
+
name: 'flights',
|
|
473
|
+
},
|
|
423
474
|
view: {
|
|
424
475
|
kind: 'segment',
|
|
425
476
|
operations: [],
|
|
@@ -431,7 +482,7 @@ describe('query builder', () => {
|
|
|
431
482
|
function add(str: string) {
|
|
432
483
|
segment.addWhere('carrier', {
|
|
433
484
|
kind: 'string',
|
|
434
|
-
|
|
485
|
+
parsed: {operator: '=', values: [str]},
|
|
435
486
|
});
|
|
436
487
|
}
|
|
437
488
|
add("'");
|
|
@@ -446,7 +497,10 @@ describe('query builder', () => {
|
|
|
446
497
|
to: {
|
|
447
498
|
definition: {
|
|
448
499
|
kind: 'arrow',
|
|
449
|
-
|
|
500
|
+
source: {
|
|
501
|
+
kind: 'source_reference',
|
|
502
|
+
name: 'flights',
|
|
503
|
+
},
|
|
450
504
|
view: {
|
|
451
505
|
kind: 'segment',
|
|
452
506
|
operations: [
|
|
@@ -518,7 +572,10 @@ describe('query builder', () => {
|
|
|
518
572
|
const from: Malloy.Query = {
|
|
519
573
|
definition: {
|
|
520
574
|
kind: 'arrow',
|
|
521
|
-
|
|
575
|
+
source: {
|
|
576
|
+
kind: 'source_reference',
|
|
577
|
+
name: 'flights',
|
|
578
|
+
},
|
|
522
579
|
view: {
|
|
523
580
|
kind: 'segment',
|
|
524
581
|
operations: [],
|
|
@@ -533,7 +590,10 @@ describe('query builder', () => {
|
|
|
533
590
|
to: {
|
|
534
591
|
definition: {
|
|
535
592
|
kind: 'arrow',
|
|
536
|
-
|
|
593
|
+
source: {
|
|
594
|
+
kind: 'source_reference',
|
|
595
|
+
name: 'flights',
|
|
596
|
+
},
|
|
537
597
|
view: {
|
|
538
598
|
kind: 'segment',
|
|
539
599
|
operations: [
|
|
@@ -558,7 +618,10 @@ describe('query builder', () => {
|
|
|
558
618
|
const from: Malloy.Query = {
|
|
559
619
|
definition: {
|
|
560
620
|
kind: 'arrow',
|
|
561
|
-
|
|
621
|
+
source: {
|
|
622
|
+
kind: 'source_reference',
|
|
623
|
+
name: 'flights',
|
|
624
|
+
},
|
|
562
625
|
view: {
|
|
563
626
|
kind: 'segment',
|
|
564
627
|
operations: [],
|
|
@@ -575,7 +638,10 @@ describe('query builder', () => {
|
|
|
575
638
|
to: {
|
|
576
639
|
definition: {
|
|
577
640
|
kind: 'arrow',
|
|
578
|
-
|
|
641
|
+
source: {
|
|
642
|
+
kind: 'source_reference',
|
|
643
|
+
name: 'flights',
|
|
644
|
+
},
|
|
579
645
|
view: {
|
|
580
646
|
kind: 'segment',
|
|
581
647
|
operations: [
|
|
@@ -613,7 +679,10 @@ describe('query builder', () => {
|
|
|
613
679
|
const from: Malloy.Query = {
|
|
614
680
|
definition: {
|
|
615
681
|
kind: 'arrow',
|
|
616
|
-
|
|
682
|
+
source: {
|
|
683
|
+
kind: 'source_reference',
|
|
684
|
+
name: 'flights',
|
|
685
|
+
},
|
|
617
686
|
view: {
|
|
618
687
|
kind: 'segment',
|
|
619
688
|
operations: [
|
|
@@ -648,7 +717,10 @@ describe('query builder', () => {
|
|
|
648
717
|
to: {
|
|
649
718
|
definition: {
|
|
650
719
|
kind: 'arrow',
|
|
651
|
-
|
|
720
|
+
source: {
|
|
721
|
+
kind: 'source_reference',
|
|
722
|
+
name: 'flights',
|
|
723
|
+
},
|
|
652
724
|
view: {
|
|
653
725
|
kind: 'segment',
|
|
654
726
|
operations: [
|
|
@@ -686,7 +758,10 @@ describe('query builder', () => {
|
|
|
686
758
|
const from: Malloy.Query = {
|
|
687
759
|
definition: {
|
|
688
760
|
kind: 'arrow',
|
|
689
|
-
|
|
761
|
+
source: {
|
|
762
|
+
kind: 'source_reference',
|
|
763
|
+
name: 'flights',
|
|
764
|
+
},
|
|
690
765
|
view: {
|
|
691
766
|
kind: 'segment',
|
|
692
767
|
operations: [],
|
|
@@ -704,7 +779,10 @@ describe('query builder', () => {
|
|
|
704
779
|
to: {
|
|
705
780
|
definition: {
|
|
706
781
|
kind: 'arrow',
|
|
707
|
-
|
|
782
|
+
source: {
|
|
783
|
+
kind: 'source_reference',
|
|
784
|
+
name: 'flights',
|
|
785
|
+
},
|
|
708
786
|
view: {
|
|
709
787
|
kind: 'segment',
|
|
710
788
|
operations: [
|
|
@@ -739,7 +817,10 @@ describe('query builder', () => {
|
|
|
739
817
|
const from: Malloy.Query = {
|
|
740
818
|
definition: {
|
|
741
819
|
kind: 'arrow',
|
|
742
|
-
|
|
820
|
+
source: {
|
|
821
|
+
kind: 'source_reference',
|
|
822
|
+
name: 'flights',
|
|
823
|
+
},
|
|
743
824
|
view: {
|
|
744
825
|
kind: 'segment',
|
|
745
826
|
operations: [],
|
|
@@ -755,7 +836,10 @@ describe('query builder', () => {
|
|
|
755
836
|
to: {
|
|
756
837
|
definition: {
|
|
757
838
|
kind: 'arrow',
|
|
758
|
-
|
|
839
|
+
source: {
|
|
840
|
+
kind: 'source_reference',
|
|
841
|
+
name: 'flights',
|
|
842
|
+
},
|
|
759
843
|
view: {
|
|
760
844
|
kind: 'segment',
|
|
761
845
|
operations: [
|
|
@@ -779,7 +863,10 @@ describe('query builder', () => {
|
|
|
779
863
|
const from: Malloy.Query = {
|
|
780
864
|
definition: {
|
|
781
865
|
kind: 'arrow',
|
|
782
|
-
|
|
866
|
+
source: {
|
|
867
|
+
kind: 'source_reference',
|
|
868
|
+
name: 'flights',
|
|
869
|
+
},
|
|
783
870
|
view: {
|
|
784
871
|
kind: 'segment',
|
|
785
872
|
operations: [],
|
|
@@ -794,7 +881,10 @@ describe('query builder', () => {
|
|
|
794
881
|
to: {
|
|
795
882
|
definition: {
|
|
796
883
|
kind: 'arrow',
|
|
797
|
-
|
|
884
|
+
source: {
|
|
885
|
+
kind: 'source_reference',
|
|
886
|
+
name: 'flights',
|
|
887
|
+
},
|
|
798
888
|
view: {
|
|
799
889
|
kind: 'view_reference',
|
|
800
890
|
name: 'by_month',
|
|
@@ -808,7 +898,10 @@ describe('query builder', () => {
|
|
|
808
898
|
const from: Malloy.Query = {
|
|
809
899
|
definition: {
|
|
810
900
|
kind: 'arrow',
|
|
811
|
-
|
|
901
|
+
source: {
|
|
902
|
+
kind: 'source_reference',
|
|
903
|
+
name: 'flights',
|
|
904
|
+
},
|
|
812
905
|
view: {
|
|
813
906
|
kind: 'segment',
|
|
814
907
|
operations: [],
|
|
@@ -824,7 +917,10 @@ describe('query builder', () => {
|
|
|
824
917
|
to: {
|
|
825
918
|
definition: {
|
|
826
919
|
kind: 'arrow',
|
|
827
|
-
|
|
920
|
+
source: {
|
|
921
|
+
kind: 'source_reference',
|
|
922
|
+
name: 'flights',
|
|
923
|
+
},
|
|
828
924
|
view: {
|
|
829
925
|
kind: 'view_reference',
|
|
830
926
|
name: 'by_month',
|
|
@@ -841,7 +937,10 @@ describe('query builder', () => {
|
|
|
841
937
|
const from: Malloy.Query = {
|
|
842
938
|
definition: {
|
|
843
939
|
kind: 'arrow',
|
|
844
|
-
|
|
940
|
+
source: {
|
|
941
|
+
kind: 'source_reference',
|
|
942
|
+
name: 'flights',
|
|
943
|
+
},
|
|
845
944
|
view: {
|
|
846
945
|
kind: 'segment',
|
|
847
946
|
operations: [],
|
|
@@ -858,7 +957,10 @@ describe('query builder', () => {
|
|
|
858
957
|
to: {
|
|
859
958
|
definition: {
|
|
860
959
|
kind: 'arrow',
|
|
861
|
-
|
|
960
|
+
source: {
|
|
961
|
+
kind: 'source_reference',
|
|
962
|
+
name: 'flights',
|
|
963
|
+
},
|
|
862
964
|
view: {
|
|
863
965
|
kind: 'refinement',
|
|
864
966
|
base: {
|
|
@@ -885,7 +987,8 @@ describe('query builder', () => {
|
|
|
885
987
|
const from: Malloy.Query = {
|
|
886
988
|
definition: {
|
|
887
989
|
kind: 'arrow',
|
|
888
|
-
|
|
990
|
+
source: {
|
|
991
|
+
kind: 'source_reference',
|
|
889
992
|
name: 'flights',
|
|
890
993
|
},
|
|
891
994
|
view: {
|
|
@@ -937,7 +1040,8 @@ describe('query builder', () => {
|
|
|
937
1040
|
to: {
|
|
938
1041
|
definition: {
|
|
939
1042
|
kind: 'arrow',
|
|
940
|
-
|
|
1043
|
+
source: {
|
|
1044
|
+
kind: 'source_reference',
|
|
941
1045
|
name: 'flights',
|
|
942
1046
|
},
|
|
943
1047
|
view: {
|
|
@@ -1001,7 +1105,10 @@ describe('query builder', () => {
|
|
|
1001
1105
|
const from: Malloy.Query = {
|
|
1002
1106
|
definition: {
|
|
1003
1107
|
kind: 'arrow',
|
|
1004
|
-
|
|
1108
|
+
source: {
|
|
1109
|
+
kind: 'source_reference',
|
|
1110
|
+
name: 'flights',
|
|
1111
|
+
},
|
|
1005
1112
|
view: {
|
|
1006
1113
|
kind: 'view_reference',
|
|
1007
1114
|
name: 'by_month',
|
|
@@ -1016,7 +1123,10 @@ describe('query builder', () => {
|
|
|
1016
1123
|
to: {
|
|
1017
1124
|
definition: {
|
|
1018
1125
|
kind: 'arrow',
|
|
1019
|
-
|
|
1126
|
+
source: {
|
|
1127
|
+
kind: 'source_reference',
|
|
1128
|
+
name: 'flights',
|
|
1129
|
+
},
|
|
1020
1130
|
view: {
|
|
1021
1131
|
kind: 'refinement',
|
|
1022
1132
|
base: {
|
|
@@ -1050,7 +1160,10 @@ describe('query builder', () => {
|
|
|
1050
1160
|
from: {
|
|
1051
1161
|
definition: {
|
|
1052
1162
|
kind: 'arrow',
|
|
1053
|
-
|
|
1163
|
+
source: {
|
|
1164
|
+
kind: 'source_reference',
|
|
1165
|
+
name: 'flights',
|
|
1166
|
+
},
|
|
1054
1167
|
view: {
|
|
1055
1168
|
kind: 'segment',
|
|
1056
1169
|
operations: [],
|
|
@@ -1060,7 +1173,10 @@ describe('query builder', () => {
|
|
|
1060
1173
|
to: {
|
|
1061
1174
|
definition: {
|
|
1062
1175
|
kind: 'arrow',
|
|
1063
|
-
|
|
1176
|
+
source: {
|
|
1177
|
+
kind: 'source_reference',
|
|
1178
|
+
name: 'flights',
|
|
1179
|
+
},
|
|
1064
1180
|
view: {
|
|
1065
1181
|
kind: 'segment',
|
|
1066
1182
|
operations: [],
|
|
@@ -1074,7 +1190,10 @@ describe('query builder', () => {
|
|
|
1074
1190
|
const from: Malloy.Query = {
|
|
1075
1191
|
definition: {
|
|
1076
1192
|
kind: 'arrow',
|
|
1077
|
-
|
|
1193
|
+
source: {
|
|
1194
|
+
kind: 'source_reference',
|
|
1195
|
+
name: 'flights',
|
|
1196
|
+
},
|
|
1078
1197
|
view: {
|
|
1079
1198
|
kind: 'view_reference',
|
|
1080
1199
|
name: 'by_carrier',
|
|
@@ -1143,7 +1262,10 @@ describe('query builder', () => {
|
|
|
1143
1262
|
to: {
|
|
1144
1263
|
definition: {
|
|
1145
1264
|
kind: 'arrow',
|
|
1146
|
-
|
|
1265
|
+
source: {
|
|
1266
|
+
kind: 'source_reference',
|
|
1267
|
+
name: 'flights',
|
|
1268
|
+
},
|
|
1147
1269
|
view: {
|
|
1148
1270
|
kind: 'refinement',
|
|
1149
1271
|
base: {
|
|
@@ -1164,7 +1286,10 @@ describe('query builder', () => {
|
|
|
1164
1286
|
const from: Malloy.Query = {
|
|
1165
1287
|
definition: {
|
|
1166
1288
|
kind: 'arrow',
|
|
1167
|
-
|
|
1289
|
+
source: {
|
|
1290
|
+
kind: 'source_reference',
|
|
1291
|
+
name: 'flights',
|
|
1292
|
+
},
|
|
1168
1293
|
view: {
|
|
1169
1294
|
kind: 'segment',
|
|
1170
1295
|
operations: [],
|
|
@@ -1180,7 +1305,10 @@ describe('query builder', () => {
|
|
|
1180
1305
|
to: {
|
|
1181
1306
|
definition: {
|
|
1182
1307
|
kind: 'arrow',
|
|
1183
|
-
|
|
1308
|
+
source: {
|
|
1309
|
+
kind: 'source_reference',
|
|
1310
|
+
name: 'flights',
|
|
1311
|
+
},
|
|
1184
1312
|
view: {
|
|
1185
1313
|
kind: 'segment',
|
|
1186
1314
|
operations: [
|
|
@@ -1199,7 +1327,10 @@ describe('query builder', () => {
|
|
|
1199
1327
|
const from: Malloy.Query = {
|
|
1200
1328
|
definition: {
|
|
1201
1329
|
kind: 'arrow',
|
|
1202
|
-
|
|
1330
|
+
source: {
|
|
1331
|
+
kind: 'source_reference',
|
|
1332
|
+
name: 'flights',
|
|
1333
|
+
},
|
|
1203
1334
|
view: {
|
|
1204
1335
|
kind: 'segment',
|
|
1205
1336
|
operations: [
|
|
@@ -1220,7 +1351,10 @@ describe('query builder', () => {
|
|
|
1220
1351
|
to: {
|
|
1221
1352
|
definition: {
|
|
1222
1353
|
kind: 'arrow',
|
|
1223
|
-
|
|
1354
|
+
source: {
|
|
1355
|
+
kind: 'source_reference',
|
|
1356
|
+
name: 'flights',
|
|
1357
|
+
},
|
|
1224
1358
|
view: {
|
|
1225
1359
|
kind: 'segment',
|
|
1226
1360
|
operations: [
|
|
@@ -1240,7 +1374,10 @@ describe('query builder', () => {
|
|
|
1240
1374
|
const from: Malloy.Query = {
|
|
1241
1375
|
definition: {
|
|
1242
1376
|
kind: 'arrow',
|
|
1243
|
-
|
|
1377
|
+
source: {
|
|
1378
|
+
kind: 'source_reference',
|
|
1379
|
+
name: 'flights',
|
|
1380
|
+
},
|
|
1244
1381
|
view: {
|
|
1245
1382
|
kind: 'segment',
|
|
1246
1383
|
operations: [],
|
|
@@ -1256,7 +1393,10 @@ describe('query builder', () => {
|
|
|
1256
1393
|
to: {
|
|
1257
1394
|
definition: {
|
|
1258
1395
|
kind: 'arrow',
|
|
1259
|
-
|
|
1396
|
+
source: {
|
|
1397
|
+
kind: 'source_reference',
|
|
1398
|
+
name: 'flights',
|
|
1399
|
+
},
|
|
1260
1400
|
view: {
|
|
1261
1401
|
kind: 'segment',
|
|
1262
1402
|
operations: [
|
|
@@ -1285,7 +1425,10 @@ describe('query builder', () => {
|
|
|
1285
1425
|
const from: Malloy.Query = {
|
|
1286
1426
|
definition: {
|
|
1287
1427
|
kind: 'arrow',
|
|
1288
|
-
|
|
1428
|
+
source: {
|
|
1429
|
+
kind: 'source_reference',
|
|
1430
|
+
name: 'flights',
|
|
1431
|
+
},
|
|
1289
1432
|
view: {
|
|
1290
1433
|
kind: 'segment',
|
|
1291
1434
|
operations: [],
|
|
@@ -1300,7 +1443,10 @@ describe('query builder', () => {
|
|
|
1300
1443
|
to: {
|
|
1301
1444
|
definition: {
|
|
1302
1445
|
kind: 'arrow',
|
|
1303
|
-
|
|
1446
|
+
source: {
|
|
1447
|
+
kind: 'source_reference',
|
|
1448
|
+
name: 'flights',
|
|
1449
|
+
},
|
|
1304
1450
|
view: {
|
|
1305
1451
|
kind: 'segment',
|
|
1306
1452
|
operations: [],
|
|
@@ -1318,7 +1464,10 @@ describe('query builder', () => {
|
|
|
1318
1464
|
const from: Malloy.Query = {
|
|
1319
1465
|
definition: {
|
|
1320
1466
|
kind: 'arrow',
|
|
1321
|
-
|
|
1467
|
+
source: {
|
|
1468
|
+
kind: 'source_reference',
|
|
1469
|
+
name: 'flights',
|
|
1470
|
+
},
|
|
1322
1471
|
view: {
|
|
1323
1472
|
kind: 'segment',
|
|
1324
1473
|
operations: [],
|
|
@@ -1347,7 +1496,10 @@ describe('query builder', () => {
|
|
|
1347
1496
|
to: {
|
|
1348
1497
|
definition: {
|
|
1349
1498
|
kind: 'arrow',
|
|
1350
|
-
|
|
1499
|
+
source: {
|
|
1500
|
+
kind: 'source_reference',
|
|
1501
|
+
name: 'flights',
|
|
1502
|
+
},
|
|
1351
1503
|
view: {
|
|
1352
1504
|
kind: 'segment',
|
|
1353
1505
|
operations: [
|
|
@@ -1377,7 +1529,10 @@ describe('query builder', () => {
|
|
|
1377
1529
|
const from: Malloy.Query = {
|
|
1378
1530
|
definition: {
|
|
1379
1531
|
kind: 'arrow',
|
|
1380
|
-
|
|
1532
|
+
source: {
|
|
1533
|
+
kind: 'source_reference',
|
|
1534
|
+
name: 'flights',
|
|
1535
|
+
},
|
|
1381
1536
|
view: {
|
|
1382
1537
|
kind: 'segment',
|
|
1383
1538
|
operations: [
|
|
@@ -1406,7 +1561,10 @@ describe('query builder', () => {
|
|
|
1406
1561
|
to: {
|
|
1407
1562
|
definition: {
|
|
1408
1563
|
kind: 'arrow',
|
|
1409
|
-
|
|
1564
|
+
source: {
|
|
1565
|
+
kind: 'source_reference',
|
|
1566
|
+
name: 'flights',
|
|
1567
|
+
},
|
|
1410
1568
|
view: {
|
|
1411
1569
|
kind: 'segment',
|
|
1412
1570
|
operations: [
|
|
@@ -1440,7 +1598,10 @@ describe('query builder', () => {
|
|
|
1440
1598
|
const from: Malloy.Query = {
|
|
1441
1599
|
definition: {
|
|
1442
1600
|
kind: 'arrow',
|
|
1443
|
-
|
|
1601
|
+
source: {
|
|
1602
|
+
kind: 'source_reference',
|
|
1603
|
+
name: 'flights',
|
|
1604
|
+
},
|
|
1444
1605
|
view: {
|
|
1445
1606
|
kind: 'refinement',
|
|
1446
1607
|
base: {
|
|
@@ -1481,7 +1642,10 @@ describe('query builder', () => {
|
|
|
1481
1642
|
to: {
|
|
1482
1643
|
definition: {
|
|
1483
1644
|
kind: 'arrow',
|
|
1484
|
-
|
|
1645
|
+
source: {
|
|
1646
|
+
kind: 'source_reference',
|
|
1647
|
+
name: 'flights',
|
|
1648
|
+
},
|
|
1485
1649
|
view: {
|
|
1486
1650
|
kind: 'refinement',
|
|
1487
1651
|
base: {
|
|
@@ -1519,7 +1683,10 @@ describe('query builder', () => {
|
|
|
1519
1683
|
const from: Malloy.Query = {
|
|
1520
1684
|
definition: {
|
|
1521
1685
|
kind: 'arrow',
|
|
1522
|
-
|
|
1686
|
+
source: {
|
|
1687
|
+
kind: 'source_reference',
|
|
1688
|
+
name: 'flights',
|
|
1689
|
+
},
|
|
1523
1690
|
view: {
|
|
1524
1691
|
kind: 'refinement',
|
|
1525
1692
|
base: {
|
|
@@ -1560,7 +1727,10 @@ describe('query builder', () => {
|
|
|
1560
1727
|
to: {
|
|
1561
1728
|
definition: {
|
|
1562
1729
|
kind: 'arrow',
|
|
1563
|
-
|
|
1730
|
+
source: {
|
|
1731
|
+
kind: 'source_reference',
|
|
1732
|
+
name: 'flights',
|
|
1733
|
+
},
|
|
1564
1734
|
view: {
|
|
1565
1735
|
kind: 'refinement',
|
|
1566
1736
|
base: {
|
|
@@ -1581,7 +1751,10 @@ describe('query builder', () => {
|
|
|
1581
1751
|
const from: Malloy.Query = {
|
|
1582
1752
|
definition: {
|
|
1583
1753
|
kind: 'arrow',
|
|
1584
|
-
|
|
1754
|
+
source: {
|
|
1755
|
+
kind: 'source_reference',
|
|
1756
|
+
name: 'flights',
|
|
1757
|
+
},
|
|
1585
1758
|
view: {
|
|
1586
1759
|
kind: 'arrow',
|
|
1587
1760
|
source: {
|
|
@@ -1627,7 +1800,10 @@ describe('query builder', () => {
|
|
|
1627
1800
|
to: {
|
|
1628
1801
|
definition: {
|
|
1629
1802
|
kind: 'arrow',
|
|
1630
|
-
|
|
1803
|
+
source: {
|
|
1804
|
+
kind: 'source_reference',
|
|
1805
|
+
name: 'flights',
|
|
1806
|
+
},
|
|
1631
1807
|
view: {
|
|
1632
1808
|
kind: 'arrow',
|
|
1633
1809
|
source: {
|
|
@@ -1653,7 +1829,10 @@ describe('query builder', () => {
|
|
|
1653
1829
|
from: {
|
|
1654
1830
|
definition: {
|
|
1655
1831
|
kind: 'arrow',
|
|
1656
|
-
|
|
1832
|
+
source: {
|
|
1833
|
+
kind: 'source_reference',
|
|
1834
|
+
name: 'flights',
|
|
1835
|
+
},
|
|
1657
1836
|
view: {
|
|
1658
1837
|
kind: 'segment',
|
|
1659
1838
|
operations: [],
|
|
@@ -1663,7 +1842,10 @@ describe('query builder', () => {
|
|
|
1663
1842
|
to: {
|
|
1664
1843
|
definition: {
|
|
1665
1844
|
kind: 'arrow',
|
|
1666
|
-
|
|
1845
|
+
source: {
|
|
1846
|
+
kind: 'source_reference',
|
|
1847
|
+
name: 'flights',
|
|
1848
|
+
},
|
|
1667
1849
|
view: {
|
|
1668
1850
|
kind: 'segment',
|
|
1669
1851
|
operations: [],
|
|
@@ -1681,7 +1863,10 @@ describe('query builder', () => {
|
|
|
1681
1863
|
from: {
|
|
1682
1864
|
definition: {
|
|
1683
1865
|
kind: 'arrow',
|
|
1684
|
-
|
|
1866
|
+
source: {
|
|
1867
|
+
kind: 'source_reference',
|
|
1868
|
+
name: 'flights',
|
|
1869
|
+
},
|
|
1685
1870
|
view: {
|
|
1686
1871
|
kind: 'view_reference',
|
|
1687
1872
|
name: 'by_month',
|
|
@@ -1691,7 +1876,10 @@ describe('query builder', () => {
|
|
|
1691
1876
|
to: {
|
|
1692
1877
|
definition: {
|
|
1693
1878
|
kind: 'arrow',
|
|
1694
|
-
|
|
1879
|
+
source: {
|
|
1880
|
+
kind: 'source_reference',
|
|
1881
|
+
name: 'flights',
|
|
1882
|
+
},
|
|
1695
1883
|
view: {
|
|
1696
1884
|
kind: 'refinement',
|
|
1697
1885
|
base: {
|
|
@@ -1716,7 +1904,10 @@ describe('query builder', () => {
|
|
|
1716
1904
|
from: {
|
|
1717
1905
|
definition: {
|
|
1718
1906
|
kind: 'arrow',
|
|
1719
|
-
|
|
1907
|
+
source: {
|
|
1908
|
+
kind: 'source_reference',
|
|
1909
|
+
name: 'flights',
|
|
1910
|
+
},
|
|
1720
1911
|
view: {
|
|
1721
1912
|
kind: 'refinement',
|
|
1722
1913
|
base: {
|
|
@@ -1733,7 +1924,10 @@ describe('query builder', () => {
|
|
|
1733
1924
|
to: {
|
|
1734
1925
|
definition: {
|
|
1735
1926
|
kind: 'arrow',
|
|
1736
|
-
|
|
1927
|
+
source: {
|
|
1928
|
+
kind: 'source_reference',
|
|
1929
|
+
name: 'flights',
|
|
1930
|
+
},
|
|
1737
1931
|
view: {
|
|
1738
1932
|
kind: 'refinement',
|
|
1739
1933
|
base: {
|
|
@@ -1764,7 +1958,10 @@ describe('query builder', () => {
|
|
|
1764
1958
|
to: {
|
|
1765
1959
|
definition: {
|
|
1766
1960
|
kind: 'refinement',
|
|
1767
|
-
|
|
1961
|
+
base: {
|
|
1962
|
+
kind: 'query_reference',
|
|
1963
|
+
name: 'flights_by_carrier',
|
|
1964
|
+
},
|
|
1768
1965
|
refinement: {
|
|
1769
1966
|
kind: 'segment',
|
|
1770
1967
|
operations: [],
|
|
@@ -1783,7 +1980,10 @@ describe('query builder', () => {
|
|
|
1783
1980
|
from: {
|
|
1784
1981
|
definition: {
|
|
1785
1982
|
kind: 'arrow',
|
|
1786
|
-
|
|
1983
|
+
source: {
|
|
1984
|
+
kind: 'source_reference',
|
|
1985
|
+
name: 'flights',
|
|
1986
|
+
},
|
|
1787
1987
|
view: {
|
|
1788
1988
|
kind: 'refinement',
|
|
1789
1989
|
base: {
|
|
@@ -1800,7 +2000,10 @@ describe('query builder', () => {
|
|
|
1800
2000
|
to: {
|
|
1801
2001
|
definition: {
|
|
1802
2002
|
kind: 'arrow',
|
|
1803
|
-
|
|
2003
|
+
source: {
|
|
2004
|
+
kind: 'source_reference',
|
|
2005
|
+
name: 'flights',
|
|
2006
|
+
},
|
|
1804
2007
|
view: {
|
|
1805
2008
|
kind: 'refinement',
|
|
1806
2009
|
base: {
|
|
@@ -1829,7 +2032,7 @@ describe('query builder', () => {
|
|
|
1829
2032
|
const from: Malloy.Query = {
|
|
1830
2033
|
definition: {
|
|
1831
2034
|
kind: 'arrow',
|
|
1832
|
-
|
|
2035
|
+
source: {kind: 'source_reference', name: 'foo'},
|
|
1833
2036
|
view: {
|
|
1834
2037
|
kind: 'segment',
|
|
1835
2038
|
operations: [],
|
|
@@ -1837,7 +2040,9 @@ describe('query builder', () => {
|
|
|
1837
2040
|
},
|
|
1838
2041
|
};
|
|
1839
2042
|
expect((q: ASTQuery) => {
|
|
1840
|
-
const source = q.definition.as
|
|
2043
|
+
const source = q.definition.as
|
|
2044
|
+
.ArrowQueryDefinition()
|
|
2045
|
+
.source.as.ReferenceQueryArrowSource();
|
|
1841
2046
|
source.setParameter('string_param', 'COOL');
|
|
1842
2047
|
source.setParameter('number_param', 7);
|
|
1843
2048
|
source.setParameter('boolean_param', true);
|
|
@@ -1886,7 +2091,8 @@ describe('query builder', () => {
|
|
|
1886
2091
|
to: {
|
|
1887
2092
|
definition: {
|
|
1888
2093
|
kind: 'arrow',
|
|
1889
|
-
|
|
2094
|
+
source: {
|
|
2095
|
+
kind: 'source_reference',
|
|
1890
2096
|
name: 'foo',
|
|
1891
2097
|
parameters: [
|
|
1892
2098
|
{
|