@malloydata/malloy-interfaces 0.0.240-dev250311155207 → 0.0.240-dev250311202829

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/index.js CHANGED
@@ -150,10 +150,11 @@ exports.test = {
150
150
  exports.res = {
151
151
  connection_name: 'foo',
152
152
  data: {
153
- kind: 'table',
154
- rows: [
153
+ kind: 'array_cell',
154
+ array_value: [
155
155
  {
156
- cells: [
156
+ kind: 'record_cell',
157
+ record_value: [
157
158
  {
158
159
  kind: 'string_cell',
159
160
  string_value: 'UA',
@@ -165,7 +166,8 @@ exports.res = {
165
166
  ],
166
167
  },
167
168
  {
168
- cells: [
169
+ kind: 'record_cell',
170
+ record_value: [
169
171
  {
170
172
  kind: 'string_cell',
171
173
  string_value: 'AA',
package/dist/types.d.ts CHANGED
@@ -54,8 +54,8 @@ export type BooleanLiteral = {
54
54
  boolean_value: boolean;
55
55
  };
56
56
  export type BooleanType = {};
57
- export type CellType = 'string_cell' | 'boolean_cell' | 'date_cell' | 'timestamp_cell' | 'number_cell' | 'json_cell' | 'record_cell' | 'array_cell' | 'table_cell';
58
- export type Cell = CellWithStringCell | CellWithBooleanCell | CellWithDateCell | CellWithTimestampCell | CellWithNumberCell | CellWithJSONCell | CellWithRecordCell | CellWithArrayCell | CellWithTableCell;
57
+ export type CellType = 'string_cell' | 'boolean_cell' | 'date_cell' | 'timestamp_cell' | 'number_cell' | 'json_cell' | 'record_cell' | 'array_cell' | 'null_cell' | 'sql_native_cell';
58
+ export type Cell = CellWithStringCell | CellWithBooleanCell | CellWithDateCell | CellWithTimestampCell | CellWithNumberCell | CellWithJSONCell | CellWithRecordCell | CellWithArrayCell | CellWithNullCell | CellWithSQLNativeCell;
59
59
  export type CellWithStringCell = {
60
60
  kind: 'string_cell';
61
61
  } & StringCell;
@@ -80,9 +80,12 @@ export type CellWithRecordCell = {
80
80
  export type CellWithArrayCell = {
81
81
  kind: 'array_cell';
82
82
  } & ArrayCell;
83
- export type CellWithTableCell = {
84
- kind: 'table_cell';
85
- } & TableCell;
83
+ export type CellWithNullCell = {
84
+ kind: 'null_cell';
85
+ } & NullCell;
86
+ export type CellWithSQLNativeCell = {
87
+ kind: 'sql_native_cell';
88
+ } & SQLNativeCell;
86
89
  export type CompileModelRequest = {
87
90
  model_url: string;
88
91
  extend_model_url?: string;
@@ -125,14 +128,14 @@ export type Connection = {
125
128
  name: string;
126
129
  dialect?: string;
127
130
  };
128
- export type DataType = 'record' | 'table';
129
- export type Data = DataWithRecord | DataWithTable;
130
- export type DataWithRecord = {
131
- kind: 'record';
131
+ export type DataType = 'record_cell' | 'array_cell';
132
+ export type Data = DataWithRecordCell | DataWithArrayCell;
133
+ export type DataWithRecordCell = {
134
+ kind: 'record_cell';
132
135
  } & RecordCell;
133
- export type DataWithTable = {
134
- kind: 'table';
135
- } & Table;
136
+ export type DataWithArrayCell = {
137
+ kind: 'array_cell';
138
+ } & ArrayCell;
136
139
  export type DateCell = {
137
140
  date_value: string;
138
141
  };
@@ -274,6 +277,7 @@ export type Nest = {
274
277
  name?: string;
275
278
  view: View;
276
279
  };
280
+ export type NullCell = {};
277
281
  export type NullLiteral = {};
278
282
  export type NumberCell = {
279
283
  number_value: number;
@@ -355,9 +359,9 @@ export type Result = {
355
359
  schema: Schema;
356
360
  sql?: string;
357
361
  connection_name: string;
358
- };
359
- export type Row = {
360
- cells: Array<Cell>;
362
+ annotations?: Array<Annotation>;
363
+ model_annotations?: Array<Annotation>;
364
+ query_timezone?: string;
361
365
  };
362
366
  export type RunIndexQueryRequest = {
363
367
  model_url: string;
@@ -378,6 +382,9 @@ export type RunQueryResponse = {
378
382
  logs?: Array<LogMessage>;
379
383
  compiler_needs?: CompilerNeeds;
380
384
  };
385
+ export type SQLNativeCell = {
386
+ sql_native_value: string;
387
+ };
381
388
  export type SQLNativeType = {
382
389
  sql_type?: string;
383
390
  };
@@ -407,12 +414,6 @@ export type StringLiteral = {
407
414
  string_value: string;
408
415
  };
409
416
  export type StringType = {};
410
- export type Table = {
411
- rows: Array<Row>;
412
- };
413
- export type TableCell = {
414
- table_value: Table;
415
- };
416
417
  export type TimeTruncationFieldReference = {
417
418
  field_reference: Reference;
418
419
  truncation: TimestampTimeframe;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy-interfaces",
3
- "version": "0.0.240-dev250311155207",
3
+ "version": "0.0.240-dev250311202829",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -423,6 +423,8 @@ struct NumberCell {
423
423
  1: required double number_value,
424
424
  }
425
425
 
426
+ struct NullCell {}
427
+
426
428
  struct TimestampCell {
427
429
  1: required string timestamp_value, // TODO another way to represent dates?
428
430
  }
@@ -435,6 +437,10 @@ struct JSONCell {
435
437
  1: required string json_value,
436
438
  }
437
439
 
440
+ struct SQLNativeCell {
441
+ 1: required string sql_native_value,
442
+ }
443
+
438
444
  struct ArrayCell {
439
445
  1: required list<Cell> array_value,
440
446
  }
@@ -444,10 +450,6 @@ struct RecordCell {
444
450
  1: required list<Cell> record_value,
445
451
  }
446
452
 
447
- struct TableCell {
448
- 1: required Table table_value,
449
- }
450
-
451
453
  union Cell {
452
454
  1: required StringCell string_cell,
453
455
  2: required BooleanCell boolean_cell,
@@ -457,21 +459,13 @@ union Cell {
457
459
  6: required JSONCell json_cell, // TODO does this need to be here?
458
460
  7: required RecordCell record_cell,
459
461
  8: required ArrayCell array_cell,
460
- 9: required TableCell table_cell, // TODO does this need to be different from an array of records
461
- // TODO sql_native???
462
- }
463
-
464
- struct Row {
465
- 1: required list<Cell> cells,
466
- }
467
-
468
- struct Table {
469
- 1: required list<Row> rows,
462
+ 9: required NullCell null_cell,
463
+ 10: required SQLNativeCell sql_native_cell,
470
464
  }
471
465
 
472
466
  union Data {
473
- 1: required RecordCell record,
474
- 2: required Table table,
467
+ 1: required RecordCell record_cell,
468
+ 2: required ArrayCell array_cell,
475
469
  }
476
470
 
477
471
  // should this be one type "Result" with optional data/sql, or three different types?
@@ -480,6 +474,9 @@ struct Result {
480
474
  2: required Schema schema,
481
475
  3: optional string sql,
482
476
  4: required string connection_name,
477
+ 5: optional list<Annotation> annotations,
478
+ 6: optional list<Annotation> model_annotations,
479
+ 7: optional string query_timezone,
483
480
  }
484
481
 
485
482
  /*