@malloydata/malloy-interfaces 0.0.296 → 0.0.297
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/types.d.ts +10 -0
- package/dist/types.js +46 -0
- package/package.json +1 -1
- package/scripts/hacky_gen_types.ts +11 -1
- package/thrift/malloy.thrift +11 -0
package/dist/types.d.ts
CHANGED
|
@@ -115,6 +115,7 @@ export type CompileModelResponse = {
|
|
|
115
115
|
logs?: Array<LogMessage>;
|
|
116
116
|
compiler_needs?: CompilerNeeds;
|
|
117
117
|
translations?: Array<Translation>;
|
|
118
|
+
timing_info?: TimingInfo;
|
|
118
119
|
};
|
|
119
120
|
export type CompileQueryRequest = {
|
|
120
121
|
model_url: string;
|
|
@@ -128,6 +129,7 @@ export type CompileQueryResponse = {
|
|
|
128
129
|
logs?: Array<LogMessage>;
|
|
129
130
|
compiler_needs?: CompilerNeeds;
|
|
130
131
|
translations?: Array<Translation>;
|
|
132
|
+
timing_info?: TimingInfo;
|
|
131
133
|
};
|
|
132
134
|
export type CompileSourceRequest = {
|
|
133
135
|
model_url: string;
|
|
@@ -139,6 +141,7 @@ export type CompileSourceResponse = {
|
|
|
139
141
|
source?: SourceInfo;
|
|
140
142
|
logs?: Array<LogMessage>;
|
|
141
143
|
compiler_needs?: CompilerNeeds;
|
|
144
|
+
timing_info?: TimingInfo;
|
|
142
145
|
};
|
|
143
146
|
export type CompilerNeeds = {
|
|
144
147
|
table_schemas?: Array<SQLTable>;
|
|
@@ -481,6 +484,7 @@ export type RunIndexQueryRequest = {
|
|
|
481
484
|
export type RunIndexQueryResponse = {
|
|
482
485
|
result?: Result;
|
|
483
486
|
compiler_needs?: CompilerNeeds;
|
|
487
|
+
timing_info?: TimingInfo;
|
|
484
488
|
};
|
|
485
489
|
export type RunQueryRequest = {
|
|
486
490
|
model_url: string;
|
|
@@ -493,6 +497,7 @@ export type RunQueryResponse = {
|
|
|
493
497
|
default_row_limit_added?: number;
|
|
494
498
|
logs?: Array<LogMessage>;
|
|
495
499
|
compiler_needs?: CompilerNeeds;
|
|
500
|
+
timing_info?: TimingInfo;
|
|
496
501
|
};
|
|
497
502
|
export type SQLNativeCell = {
|
|
498
503
|
sql_native_value: string;
|
|
@@ -542,6 +547,11 @@ export type TimestampTimeframe = 'year' | 'quarter' | 'month' | 'week' | 'day' |
|
|
|
542
547
|
export type TimestampType = {
|
|
543
548
|
timeframe?: TimestampTimeframe;
|
|
544
549
|
};
|
|
550
|
+
export type TimingInfo = {
|
|
551
|
+
name: string;
|
|
552
|
+
duration_ms: number;
|
|
553
|
+
detailed_timing?: Array<TimingInfo>;
|
|
554
|
+
};
|
|
545
555
|
export type Translation = {
|
|
546
556
|
url: string;
|
|
547
557
|
compiled_model_json?: string;
|
package/dist/types.js
CHANGED
|
@@ -195,6 +195,11 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
195
195
|
'array': true,
|
|
196
196
|
'optional': true,
|
|
197
197
|
},
|
|
198
|
+
'timing_info': {
|
|
199
|
+
'type': 'TimingInfo',
|
|
200
|
+
'optional': true,
|
|
201
|
+
'array': false,
|
|
202
|
+
},
|
|
198
203
|
},
|
|
199
204
|
},
|
|
200
205
|
'CompileQueryRequest': {
|
|
@@ -252,6 +257,11 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
252
257
|
'array': true,
|
|
253
258
|
'optional': true,
|
|
254
259
|
},
|
|
260
|
+
'timing_info': {
|
|
261
|
+
'type': 'TimingInfo',
|
|
262
|
+
'optional': true,
|
|
263
|
+
'array': false,
|
|
264
|
+
},
|
|
255
265
|
},
|
|
256
266
|
},
|
|
257
267
|
'CompileSourceRequest': {
|
|
@@ -299,6 +309,11 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
299
309
|
'optional': true,
|
|
300
310
|
'array': false,
|
|
301
311
|
},
|
|
312
|
+
'timing_info': {
|
|
313
|
+
'type': 'TimingInfo',
|
|
314
|
+
'optional': true,
|
|
315
|
+
'array': false,
|
|
316
|
+
},
|
|
302
317
|
},
|
|
303
318
|
},
|
|
304
319
|
'CompilerNeeds': {
|
|
@@ -1236,6 +1251,11 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
1236
1251
|
'optional': true,
|
|
1237
1252
|
'array': false,
|
|
1238
1253
|
},
|
|
1254
|
+
'timing_info': {
|
|
1255
|
+
'type': 'TimingInfo',
|
|
1256
|
+
'optional': true,
|
|
1257
|
+
'array': false,
|
|
1258
|
+
},
|
|
1239
1259
|
},
|
|
1240
1260
|
},
|
|
1241
1261
|
'RunQueryRequest': {
|
|
@@ -1288,6 +1308,11 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
1288
1308
|
'optional': true,
|
|
1289
1309
|
'array': false,
|
|
1290
1310
|
},
|
|
1311
|
+
'timing_info': {
|
|
1312
|
+
'type': 'TimingInfo',
|
|
1313
|
+
'optional': true,
|
|
1314
|
+
'array': false,
|
|
1315
|
+
},
|
|
1291
1316
|
},
|
|
1292
1317
|
},
|
|
1293
1318
|
'SQLNativeCell': {
|
|
@@ -1491,6 +1516,27 @@ exports.MALLOY_INTERFACE_TYPES = {
|
|
|
1491
1516
|
},
|
|
1492
1517
|
},
|
|
1493
1518
|
},
|
|
1519
|
+
'TimingInfo': {
|
|
1520
|
+
'type': 'struct',
|
|
1521
|
+
'name': 'TimingInfo',
|
|
1522
|
+
'fields': {
|
|
1523
|
+
'name': {
|
|
1524
|
+
'type': 'string',
|
|
1525
|
+
'optional': false,
|
|
1526
|
+
'array': false,
|
|
1527
|
+
},
|
|
1528
|
+
'duration_ms': {
|
|
1529
|
+
'type': 'number',
|
|
1530
|
+
'optional': false,
|
|
1531
|
+
'array': false,
|
|
1532
|
+
},
|
|
1533
|
+
'detailed_timing': {
|
|
1534
|
+
'type': 'TimingInfo',
|
|
1535
|
+
'array': true,
|
|
1536
|
+
'optional': true,
|
|
1537
|
+
},
|
|
1538
|
+
},
|
|
1539
|
+
},
|
|
1494
1540
|
'Translation': {
|
|
1495
1541
|
'type': 'struct',
|
|
1496
1542
|
'name': 'Translation',
|
package/package.json
CHANGED
|
@@ -86,7 +86,7 @@ for (const file of fs.readdirSync('./generated-types')) {
|
|
|
86
86
|
const name = nameMatch[1];
|
|
87
87
|
const fields: Record<string, MalloyInterfaceFieldType> = {};
|
|
88
88
|
const fieldMatches = actualTypes.matchAll(
|
|
89
|
-
/ {4}([a-z_]+)(\?)?: (?:([a-z]+)|([A-Za-z]+)\.[A-Za-z]+|(?:Array<([a-z]+)>)|(?:Array<([A-Za-z]+)\.[A-Za-z]+>));/g
|
|
89
|
+
/ {4}([a-z_]+)(\?)?: (?:([a-z]+)|([A-Za-z]+)\.[A-Za-z]+|I([A-Za-z]+)|(?:Array<([a-z]+)>)|(?:Array<([A-Za-z]+)\.[A-Za-z]+>)|(?:Array<I([A-Za-z]+)>));/g
|
|
90
90
|
);
|
|
91
91
|
for (const fieldMatch of fieldMatches) {
|
|
92
92
|
const [
|
|
@@ -94,8 +94,10 @@ for (const file of fs.readdirSync('./generated-types')) {
|
|
|
94
94
|
optionalQ,
|
|
95
95
|
basicType,
|
|
96
96
|
specialType,
|
|
97
|
+
recursiveType,
|
|
97
98
|
arrayBasicType,
|
|
98
99
|
arraySpecialType,
|
|
100
|
+
arrayRecursiveType,
|
|
99
101
|
] = [
|
|
100
102
|
fieldMatch[1],
|
|
101
103
|
fieldMatch[2],
|
|
@@ -103,11 +105,14 @@ for (const file of fs.readdirSync('./generated-types')) {
|
|
|
103
105
|
fieldMatch[4],
|
|
104
106
|
fieldMatch[5],
|
|
105
107
|
fieldMatch[6],
|
|
108
|
+
fieldMatch[7],
|
|
109
|
+
fieldMatch[8],
|
|
106
110
|
];
|
|
107
111
|
const optional = optionalQ === '?';
|
|
108
112
|
const type =
|
|
109
113
|
(basicType && {type: basicType, optional, array: false}) ??
|
|
110
114
|
(specialType && {type: specialType, optional, array: false}) ??
|
|
115
|
+
(recursiveType && {type: recursiveType, optional, array: false}) ??
|
|
111
116
|
(arrayBasicType && {
|
|
112
117
|
type: arrayBasicType,
|
|
113
118
|
array: true,
|
|
@@ -117,6 +122,11 @@ for (const file of fs.readdirSync('./generated-types')) {
|
|
|
117
122
|
type: arraySpecialType,
|
|
118
123
|
array: true,
|
|
119
124
|
optional,
|
|
125
|
+
}) ??
|
|
126
|
+
(arrayRecursiveType && {
|
|
127
|
+
type: arrayRecursiveType,
|
|
128
|
+
array: true,
|
|
129
|
+
optional,
|
|
120
130
|
});
|
|
121
131
|
if (!type) throw new Error(`Invalid type ${fieldMatch[0]}`);
|
|
122
132
|
fields[name] = type;
|
package/thrift/malloy.thrift
CHANGED
|
@@ -636,6 +636,12 @@ struct LogMessage {
|
|
|
636
636
|
4: required string message;
|
|
637
637
|
}
|
|
638
638
|
|
|
639
|
+
struct TimingInfo {
|
|
640
|
+
1: required string name;
|
|
641
|
+
3: required i32 duration_ms;
|
|
642
|
+
4: optional list<TimingInfo> detailed_timing;
|
|
643
|
+
}
|
|
644
|
+
|
|
639
645
|
// Given the URL to a model, return the StableModelDef for that model
|
|
640
646
|
|
|
641
647
|
struct CompileModelRequest {
|
|
@@ -651,6 +657,7 @@ struct CompileModelResponse {
|
|
|
651
657
|
8: optional list<LogMessage> logs,
|
|
652
658
|
9: optional CompilerNeeds compiler_needs,
|
|
653
659
|
10: optional list<Translation> translations;
|
|
660
|
+
11: optional TimingInfo timing_info;
|
|
654
661
|
}
|
|
655
662
|
|
|
656
663
|
// Given the URL to a model and a name of a queryable thing, get a StableSourceDef
|
|
@@ -668,6 +675,7 @@ struct CompileSourceResponse {
|
|
|
668
675
|
|
|
669
676
|
8: optional list<LogMessage> logs,
|
|
670
677
|
9: optional CompilerNeeds compiler_needs,
|
|
678
|
+
11: optional TimingInfo timing_info;
|
|
671
679
|
}
|
|
672
680
|
|
|
673
681
|
// Given a StableQueryDef and the URL to a model, run it and return a StableResult
|
|
@@ -686,6 +694,7 @@ struct RunQueryResponse {
|
|
|
686
694
|
7: optional i32 default_row_limit_added,
|
|
687
695
|
8: optional list<LogMessage> logs,
|
|
688
696
|
9: optional CompilerNeeds compiler_needs,
|
|
697
|
+
11: optional TimingInfo timing_info;
|
|
689
698
|
}
|
|
690
699
|
|
|
691
700
|
// Given a StableQueryDef and the URL to a model, compile it and return a StableResultDef
|
|
@@ -705,6 +714,7 @@ struct CompileQueryResponse {
|
|
|
705
714
|
8: optional list<LogMessage> logs,
|
|
706
715
|
9: optional CompilerNeeds compiler_needs,
|
|
707
716
|
10: optional list<Translation> translations;
|
|
717
|
+
11: optional TimingInfo timing_info;
|
|
708
718
|
}
|
|
709
719
|
|
|
710
720
|
// Given a URL to a model and the name of a source, run the indexing query
|
|
@@ -720,4 +730,5 @@ struct RunIndexQueryResponse {
|
|
|
720
730
|
1: optional Result result,
|
|
721
731
|
|
|
722
732
|
9: optional CompilerNeeds compiler_needs,
|
|
733
|
+
11: optional TimingInfo timing_info;
|
|
723
734
|
}
|