@malloydata/malloy-interfaces 0.0.263-dev250414165131 → 0.0.263-dev250414204152
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/dist/to_malloy.js +2 -0
- package/dist/types.d.ts +46 -3
- package/dist/types.js +54 -1
- package/package.json +1 -1
- package/thrift/malloy.thrift +27 -1
package/dist/to_malloy.js
CHANGED
|
@@ -54,6 +54,8 @@ function escapeString(str) {
|
|
|
54
54
|
function literalToFragments(literal) {
|
|
55
55
|
var _a, _b;
|
|
56
56
|
switch (literal.kind) {
|
|
57
|
+
case 'filter_expression_literal':
|
|
58
|
+
return [quoteFilter(literal.filter_expression_value)];
|
|
57
59
|
case 'boolean_literal':
|
|
58
60
|
return [literal.boolean_value.toString()];
|
|
59
61
|
case 'string_literal': {
|
package/dist/types.d.ts
CHANGED
|
@@ -119,10 +119,12 @@ export type CompileModelResponse = {
|
|
|
119
119
|
export type CompileQueryRequest = {
|
|
120
120
|
model_url: string;
|
|
121
121
|
query: Query;
|
|
122
|
+
default_row_limit?: number;
|
|
122
123
|
compiler_needs?: CompilerNeeds;
|
|
123
124
|
};
|
|
124
125
|
export type CompileQueryResponse = {
|
|
125
126
|
result?: Result;
|
|
127
|
+
default_row_limit_added?: number;
|
|
126
128
|
logs?: Array<LogMessage>;
|
|
127
129
|
compiler_needs?: CompilerNeeds;
|
|
128
130
|
translations?: Array<Translation>;
|
|
@@ -220,6 +222,10 @@ export type Filter = FilterWithFilterString;
|
|
|
220
222
|
export type FilterWithFilterString = {
|
|
221
223
|
kind: 'filter_string';
|
|
222
224
|
} & FilterStringApplication;
|
|
225
|
+
export type FilterExpressionLiteral = {
|
|
226
|
+
filter_expression_value: string;
|
|
227
|
+
};
|
|
228
|
+
export type FilterExpressionType = {};
|
|
223
229
|
export type FilterOperation = {
|
|
224
230
|
filter: Filter;
|
|
225
231
|
};
|
|
@@ -248,8 +254,8 @@ export type JoinInfo = {
|
|
|
248
254
|
export type Limit = {
|
|
249
255
|
limit: number;
|
|
250
256
|
};
|
|
251
|
-
export type LiteralValueType = 'string_literal' | 'number_literal' | 'date_literal' | 'timestamp_literal' | 'boolean_literal' | 'null_literal';
|
|
252
|
-
export type LiteralValue = LiteralValueWithStringLiteral | LiteralValueWithNumberLiteral | LiteralValueWithDateLiteral | LiteralValueWithTimestampLiteral | LiteralValueWithBooleanLiteral | LiteralValueWithNullLiteral;
|
|
257
|
+
export type LiteralValueType = 'string_literal' | 'number_literal' | 'date_literal' | 'timestamp_literal' | 'boolean_literal' | 'null_literal' | 'filter_expression_literal';
|
|
258
|
+
export type LiteralValue = LiteralValueWithStringLiteral | LiteralValueWithNumberLiteral | LiteralValueWithDateLiteral | LiteralValueWithTimestampLiteral | LiteralValueWithBooleanLiteral | LiteralValueWithNullLiteral | LiteralValueWithFilterExpressionLiteral;
|
|
253
259
|
export type LiteralValueWithStringLiteral = {
|
|
254
260
|
kind: 'string_literal';
|
|
255
261
|
} & StringLiteral;
|
|
@@ -268,6 +274,9 @@ export type LiteralValueWithBooleanLiteral = {
|
|
|
268
274
|
export type LiteralValueWithNullLiteral = {
|
|
269
275
|
kind: 'null_literal';
|
|
270
276
|
} & NullLiteral;
|
|
277
|
+
export type LiteralValueWithFilterExpressionLiteral = {
|
|
278
|
+
kind: 'filter_expression_literal';
|
|
279
|
+
} & FilterExpressionLiteral;
|
|
271
280
|
export type Location = {
|
|
272
281
|
url: string;
|
|
273
282
|
range: Range;
|
|
@@ -320,9 +329,41 @@ export type OrderBy = {
|
|
|
320
329
|
export type OrderByDirection = 'asc' | 'desc';
|
|
321
330
|
export type ParameterInfo = {
|
|
322
331
|
name: string;
|
|
323
|
-
type:
|
|
332
|
+
type: ParameterType;
|
|
324
333
|
default_value?: LiteralValue;
|
|
325
334
|
};
|
|
335
|
+
export type ParameterTypeType = 'string_type' | 'boolean_type' | 'number_type' | 'json_type' | 'sql_native_type' | 'date_type' | 'timestamp_type' | 'array_type' | 'record_type' | 'filter_expression_type';
|
|
336
|
+
export type ParameterType = ParameterTypeWithStringType | ParameterTypeWithBooleanType | ParameterTypeWithNumberType | ParameterTypeWithJSONType | ParameterTypeWithSQLNativeType | ParameterTypeWithDateType | ParameterTypeWithTimestampType | ParameterTypeWithArrayType | ParameterTypeWithRecordType | ParameterTypeWithFilterExpressionType;
|
|
337
|
+
export type ParameterTypeWithStringType = {
|
|
338
|
+
kind: 'string_type';
|
|
339
|
+
} & StringType;
|
|
340
|
+
export type ParameterTypeWithBooleanType = {
|
|
341
|
+
kind: 'boolean_type';
|
|
342
|
+
} & BooleanType;
|
|
343
|
+
export type ParameterTypeWithNumberType = {
|
|
344
|
+
kind: 'number_type';
|
|
345
|
+
} & NumberType;
|
|
346
|
+
export type ParameterTypeWithJSONType = {
|
|
347
|
+
kind: 'json_type';
|
|
348
|
+
} & JSONType;
|
|
349
|
+
export type ParameterTypeWithSQLNativeType = {
|
|
350
|
+
kind: 'sql_native_type';
|
|
351
|
+
} & SQLNativeType;
|
|
352
|
+
export type ParameterTypeWithDateType = {
|
|
353
|
+
kind: 'date_type';
|
|
354
|
+
} & DateType;
|
|
355
|
+
export type ParameterTypeWithTimestampType = {
|
|
356
|
+
kind: 'timestamp_type';
|
|
357
|
+
} & TimestampType;
|
|
358
|
+
export type ParameterTypeWithArrayType = {
|
|
359
|
+
kind: 'array_type';
|
|
360
|
+
} & ArrayType;
|
|
361
|
+
export type ParameterTypeWithRecordType = {
|
|
362
|
+
kind: 'record_type';
|
|
363
|
+
} & RecordType;
|
|
364
|
+
export type ParameterTypeWithFilterExpressionType = {
|
|
365
|
+
kind: 'filter_expression_type';
|
|
366
|
+
} & FilterExpressionType;
|
|
326
367
|
export type ParameterValue = {
|
|
327
368
|
name: string;
|
|
328
369
|
value: LiteralValue;
|
|
@@ -407,10 +448,12 @@ export type RunIndexQueryResponse = {
|
|
|
407
448
|
export type RunQueryRequest = {
|
|
408
449
|
model_url: string;
|
|
409
450
|
query: Query;
|
|
451
|
+
default_row_limit?: number;
|
|
410
452
|
compiler_needs?: CompilerNeeds;
|
|
411
453
|
};
|
|
412
454
|
export type RunQueryResponse = {
|
|
413
455
|
result?: Result;
|
|
456
|
+
default_row_limit_added?: number;
|
|
414
457
|
logs?: Array<LogMessage>;
|
|
415
458
|
compiler_needs?: CompilerNeeds;
|
|
416
459
|
};
|
package/dist/types.js
CHANGED
|
@@ -211,6 +211,11 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
211
211
|
'optional': false,
|
|
212
212
|
'array': false,
|
|
213
213
|
},
|
|
214
|
+
'default_row_limit': {
|
|
215
|
+
'type': 'number',
|
|
216
|
+
'optional': true,
|
|
217
|
+
'array': false,
|
|
218
|
+
},
|
|
214
219
|
'compiler_needs': {
|
|
215
220
|
'type': 'CompilerNeeds',
|
|
216
221
|
'optional': true,
|
|
@@ -227,6 +232,11 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
227
232
|
'optional': true,
|
|
228
233
|
'array': false,
|
|
229
234
|
},
|
|
235
|
+
'default_row_limit_added': {
|
|
236
|
+
'type': 'number',
|
|
237
|
+
'optional': true,
|
|
238
|
+
'array': false,
|
|
239
|
+
},
|
|
230
240
|
'logs': {
|
|
231
241
|
'type': 'LogMessage',
|
|
232
242
|
'array': true,
|
|
@@ -511,6 +521,22 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
511
521
|
'filter_string': 'FilterStringApplication',
|
|
512
522
|
},
|
|
513
523
|
},
|
|
524
|
+
'FilterExpressionLiteral': {
|
|
525
|
+
'type': 'struct',
|
|
526
|
+
'name': 'FilterExpressionLiteral',
|
|
527
|
+
'fields': {
|
|
528
|
+
'filter_expression_value': {
|
|
529
|
+
'type': 'string',
|
|
530
|
+
'optional': false,
|
|
531
|
+
'array': false,
|
|
532
|
+
},
|
|
533
|
+
},
|
|
534
|
+
},
|
|
535
|
+
'FilterExpressionType': {
|
|
536
|
+
'type': 'struct',
|
|
537
|
+
'name': 'FilterExpressionType',
|
|
538
|
+
'fields': {},
|
|
539
|
+
},
|
|
514
540
|
'FilterOperation': {
|
|
515
541
|
'type': 'struct',
|
|
516
542
|
'name': 'FilterOperation',
|
|
@@ -633,6 +659,7 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
633
659
|
'timestamp_literal': 'TimestampLiteral',
|
|
634
660
|
'boolean_literal': 'BooleanLiteral',
|
|
635
661
|
'null_literal': 'NullLiteral',
|
|
662
|
+
'filter_expression_literal': 'FilterExpressionLiteral',
|
|
636
663
|
},
|
|
637
664
|
},
|
|
638
665
|
'Location': {
|
|
@@ -838,7 +865,7 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
838
865
|
'array': false,
|
|
839
866
|
},
|
|
840
867
|
'type': {
|
|
841
|
-
'type': '
|
|
868
|
+
'type': 'ParameterType',
|
|
842
869
|
'optional': false,
|
|
843
870
|
'array': false,
|
|
844
871
|
},
|
|
@@ -849,6 +876,22 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
849
876
|
},
|
|
850
877
|
},
|
|
851
878
|
},
|
|
879
|
+
'ParameterType': {
|
|
880
|
+
'type': 'union',
|
|
881
|
+
'name': 'ParameterType',
|
|
882
|
+
'options': {
|
|
883
|
+
'string_type': 'StringType',
|
|
884
|
+
'boolean_type': 'BooleanType',
|
|
885
|
+
'number_type': 'NumberType',
|
|
886
|
+
'json_type': 'JSONType',
|
|
887
|
+
'sql_native_type': 'SQLNativeType',
|
|
888
|
+
'date_type': 'DateType',
|
|
889
|
+
'timestamp_type': 'TimestampType',
|
|
890
|
+
'array_type': 'ArrayType',
|
|
891
|
+
'record_type': 'RecordType',
|
|
892
|
+
'filter_expression_type': 'FilterExpressionType',
|
|
893
|
+
},
|
|
894
|
+
},
|
|
852
895
|
'ParameterValue': {
|
|
853
896
|
'type': 'struct',
|
|
854
897
|
'name': 'ParameterValue',
|
|
@@ -1142,6 +1185,11 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
1142
1185
|
'optional': false,
|
|
1143
1186
|
'array': false,
|
|
1144
1187
|
},
|
|
1188
|
+
'default_row_limit': {
|
|
1189
|
+
'type': 'number',
|
|
1190
|
+
'optional': true,
|
|
1191
|
+
'array': false,
|
|
1192
|
+
},
|
|
1145
1193
|
'compiler_needs': {
|
|
1146
1194
|
'type': 'CompilerNeeds',
|
|
1147
1195
|
'optional': true,
|
|
@@ -1158,6 +1206,11 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
1158
1206
|
'optional': true,
|
|
1159
1207
|
'array': false,
|
|
1160
1208
|
},
|
|
1209
|
+
'default_row_limit_added': {
|
|
1210
|
+
'type': 'number',
|
|
1211
|
+
'optional': true,
|
|
1212
|
+
'array': false,
|
|
1213
|
+
},
|
|
1161
1214
|
'logs': {
|
|
1162
1215
|
'type': 'LogMessage',
|
|
1163
1216
|
'array': true,
|
package/package.json
CHANGED
package/thrift/malloy.thrift
CHANGED
|
@@ -25,7 +25,7 @@ struct SourceInfo {
|
|
|
25
25
|
|
|
26
26
|
struct ParameterInfo {
|
|
27
27
|
1: required string name,
|
|
28
|
-
2: required
|
|
28
|
+
2: required ParameterType type,
|
|
29
29
|
3: optional LiteralValue default_value,
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -176,6 +176,10 @@ struct RecordType {
|
|
|
176
176
|
1: required list<DimensionInfo> fields
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
+
struct FilterExpressionType {
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
179
183
|
union AtomicType {
|
|
180
184
|
1: required StringType string_type,
|
|
181
185
|
2: required BooleanType boolean_type,
|
|
@@ -188,6 +192,19 @@ union AtomicType {
|
|
|
188
192
|
10: required RecordType record_type,
|
|
189
193
|
}
|
|
190
194
|
|
|
195
|
+
union ParameterType {
|
|
196
|
+
1: required StringType string_type,
|
|
197
|
+
2: required BooleanType boolean_type,
|
|
198
|
+
3: required NumberType number_type,
|
|
199
|
+
4: required JSONType json_type,
|
|
200
|
+
5: required SQLNativeType sql_native_type,
|
|
201
|
+
6: required DateType date_type,
|
|
202
|
+
7: required TimestampType timestamp_type,
|
|
203
|
+
9: required ArrayType array_type,
|
|
204
|
+
10: required RecordType record_type,
|
|
205
|
+
11: required FilterExpressionType filter_expression_type,
|
|
206
|
+
}
|
|
207
|
+
|
|
191
208
|
struct SQLNativeType {
|
|
192
209
|
1: optional string sql_type,
|
|
193
210
|
}
|
|
@@ -373,6 +390,7 @@ union LiteralValue {
|
|
|
373
390
|
4: required TimestampLiteral timestamp_literal,
|
|
374
391
|
5: required BooleanLiteral boolean_literal,
|
|
375
392
|
6: required NullLiteral null_literal,
|
|
393
|
+
7: required FilterExpressionLiteral filter_expression_literal,
|
|
376
394
|
}
|
|
377
395
|
|
|
378
396
|
struct StringLiteral {
|
|
@@ -400,6 +418,10 @@ struct TimestampLiteral {
|
|
|
400
418
|
struct NullLiteral {
|
|
401
419
|
}
|
|
402
420
|
|
|
421
|
+
struct FilterExpressionLiteral {
|
|
422
|
+
1: required string filter_expression_value,
|
|
423
|
+
}
|
|
424
|
+
|
|
403
425
|
union Expression {
|
|
404
426
|
1: required Reference field_reference,
|
|
405
427
|
2: required TimeTruncationFieldReference time_truncation,
|
|
@@ -626,6 +648,7 @@ struct CompileSourceResponse {
|
|
|
626
648
|
struct RunQueryRequest {
|
|
627
649
|
1: required string model_url,
|
|
628
650
|
2: required Query query,
|
|
651
|
+
3: optional i32 default_row_limit,
|
|
629
652
|
|
|
630
653
|
9: optional CompilerNeeds compiler_needs,
|
|
631
654
|
}
|
|
@@ -633,6 +656,7 @@ struct RunQueryRequest {
|
|
|
633
656
|
struct RunQueryResponse {
|
|
634
657
|
1: optional Result result,
|
|
635
658
|
|
|
659
|
+
7: optional i32 default_row_limit_added,
|
|
636
660
|
8: optional list<LogMessage> logs,
|
|
637
661
|
9: optional CompilerNeeds compiler_needs,
|
|
638
662
|
}
|
|
@@ -642,6 +666,7 @@ struct RunQueryResponse {
|
|
|
642
666
|
struct CompileQueryRequest {
|
|
643
667
|
1: required string model_url,
|
|
644
668
|
2: required Query query,
|
|
669
|
+
3: optional i32 default_row_limit,
|
|
645
670
|
|
|
646
671
|
9: optional CompilerNeeds compiler_needs,
|
|
647
672
|
}
|
|
@@ -649,6 +674,7 @@ struct CompileQueryRequest {
|
|
|
649
674
|
struct CompileQueryResponse {
|
|
650
675
|
1: optional Result result,
|
|
651
676
|
|
|
677
|
+
7: optional i32 default_row_limit_added,
|
|
652
678
|
8: optional list<LogMessage> logs,
|
|
653
679
|
9: optional CompilerNeeds compiler_needs,
|
|
654
680
|
10: optional list<Translation> translations;
|