@malloydata/malloy 0.0.24-dev230217165618 → 0.0.24-dev230217181159
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/malloy.d.ts +14 -2
- package/dist/malloy.js +35 -1
- package/package.json +1 -1
package/dist/malloy.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { RunSQLOptions } from "./run_sql_options";
|
|
3
3
|
import { DocumentCompletion as DocumentCompletionDefinition, DocumentHighlight as DocumentHighlightDefinition, DocumentSymbol as DocumentSymbolDefinition, LogMessage, MalloyTranslator } from "./lang";
|
|
4
4
|
import { DocumentHelpContext } from "./lang/parse-tree-walkers/document-help-context-walker";
|
|
5
|
-
import { CompiledQuery, DocumentReference, FieldBooleanDef, FieldDateDef, FieldJSONDef, FieldNumberDef, FieldStringDef, FieldTimestampDef, FieldTypeDef, FilterExpression, Query as InternalQuery, ModelDef, DocumentPosition as ModelDocumentPosition, NamedQuery, QueryData, QueryDataRow, QueryResult, SQLBlock, SQLBlockStructDef, SearchIndexResult, SearchValueMapResult, StructDef, TurtleDef } from "./model";
|
|
5
|
+
import { CompiledQuery, DocumentReference, FieldBooleanDef, FieldDateDef, FieldJSONDef, FieldNumberDef, FieldStringDef, FieldTimestampDef, FieldTypeDef, FilterExpression, Query as InternalQuery, ModelDef, DocumentPosition as ModelDocumentPosition, NamedQuery, QueryData, QueryDataRow, QueryResult, SQLBlock, SQLBlockStructDef, SearchIndexResult, SearchValueMapResult, StructDef, TurtleDef, FieldUnsupportedDef } from "./model";
|
|
6
6
|
import { Connection, InfoConnection, LookupConnection, ModelString, ModelURL, QueryString, QueryURL, URLReader } from "./runtime_types";
|
|
7
7
|
export interface Loggable {
|
|
8
8
|
debug: (message?: any, ...optionalParams: any[]) => void;
|
|
@@ -519,6 +519,7 @@ export declare class AtomicField extends Entity {
|
|
|
519
519
|
isBoolean(): this is BooleanField;
|
|
520
520
|
isJSON(): this is JSONField;
|
|
521
521
|
isTimestamp(): this is TimestampField;
|
|
522
|
+
isUnsupported(): this is UnsupportedField;
|
|
522
523
|
get parentExplore(): Explore;
|
|
523
524
|
get expression(): string;
|
|
524
525
|
}
|
|
@@ -561,6 +562,10 @@ export declare class JSONField extends AtomicField {
|
|
|
561
562
|
private fieldJSONDef;
|
|
562
563
|
constructor(fieldJSONDef: FieldJSONDef, parent: Explore, source?: AtomicField);
|
|
563
564
|
}
|
|
565
|
+
export declare class UnsupportedField extends AtomicField {
|
|
566
|
+
private fieldUnsupportedDef;
|
|
567
|
+
constructor(fieldUnsupportedDef: FieldUnsupportedDef, parent: Explore, source?: AtomicField);
|
|
568
|
+
}
|
|
564
569
|
export declare class StringField extends AtomicField {
|
|
565
570
|
private fieldStringDef;
|
|
566
571
|
constructor(fieldStringDef: FieldStringDef, parent: Explore, source?: AtomicField);
|
|
@@ -1016,7 +1021,7 @@ export declare class Result extends PreparedResult {
|
|
|
1016
1021
|
toJSON(): ResultJSON;
|
|
1017
1022
|
static fromJSON({ queryResult, modelDef }: ResultJSON): Result;
|
|
1018
1023
|
}
|
|
1019
|
-
export declare type DataColumn = DataArray | DataRecord | DataString | DataBoolean | DataNumber | DataDate | DataTimestamp | DataNull | DataBytes | DataJSON;
|
|
1024
|
+
export declare type DataColumn = DataArray | DataRecord | DataString | DataBoolean | DataNumber | DataDate | DataTimestamp | DataNull | DataBytes | DataJSON | DataUnsupported;
|
|
1020
1025
|
export declare type DataArrayOrRecord = DataArray | DataRecord;
|
|
1021
1026
|
declare abstract class Data<T> {
|
|
1022
1027
|
protected _field: Field | Explore;
|
|
@@ -1038,6 +1043,8 @@ declare abstract class Data<T> {
|
|
|
1038
1043
|
get bytes(): DataBytes;
|
|
1039
1044
|
isRecord(): this is DataRecord;
|
|
1040
1045
|
get record(): DataRecord;
|
|
1046
|
+
isUnsupported(): this is DataUnsupported;
|
|
1047
|
+
get unsupported(): DataUnsupported;
|
|
1041
1048
|
isArray(): this is DataArray;
|
|
1042
1049
|
get array(): DataArray;
|
|
1043
1050
|
isArrayOrRecord(): DataArrayOrRecord;
|
|
@@ -1054,6 +1061,11 @@ declare class DataString extends ScalarData<string> {
|
|
|
1054
1061
|
constructor(value: string, field: StringField);
|
|
1055
1062
|
get field(): StringField;
|
|
1056
1063
|
}
|
|
1064
|
+
declare class DataUnsupported extends ScalarData<unknown> {
|
|
1065
|
+
protected _field: UnsupportedField;
|
|
1066
|
+
constructor(value: unknown, field: UnsupportedField);
|
|
1067
|
+
get field(): UnsupportedField;
|
|
1068
|
+
}
|
|
1057
1069
|
declare class DataBoolean extends ScalarData<boolean> {
|
|
1058
1070
|
protected _field: BooleanField;
|
|
1059
1071
|
constructor(value: boolean, field: BooleanField);
|
package/dist/malloy.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.CSVWriter = exports.JSONWriter = exports.DataWriter = exports.DataRecord = exports.DataArray = exports.Result = exports.ExploreMaterializer = exports.SQLBlockMaterializer = exports.PreparedResultMaterializer = exports.QueryMaterializer = exports.ModelMaterializer = exports.SingleConnectionRuntime = exports.ConnectionRuntime = exports.Runtime = exports.ExploreField = exports.JoinRelationship = exports.QueryField = exports.Query = exports.StringField = exports.JSONField = exports.BooleanField = exports.NumberField = exports.TimestampField = exports.DateField = exports.TimestampTimeframe = exports.DateTimeframe = exports.AtomicField = exports.AtomicFieldType = exports.Explore = exports.SourceRelationship = exports.FixedConnectionMap = exports.InMemoryURLReader = exports.EmptyURLReader = exports.PreparedResult = exports.DocumentCompletion = exports.DocumentSymbol = exports.DocumentPosition = exports.DocumentRange = exports.DocumentHighlight = exports.Parse = exports.parseTableURI = exports.PreparedQuery = exports.Model = exports.MalloyError = exports.Malloy = void 0;
|
|
25
|
+
exports.CSVWriter = exports.JSONWriter = exports.DataWriter = exports.DataRecord = exports.DataArray = exports.Result = exports.ExploreMaterializer = exports.SQLBlockMaterializer = exports.PreparedResultMaterializer = exports.QueryMaterializer = exports.ModelMaterializer = exports.SingleConnectionRuntime = exports.ConnectionRuntime = exports.Runtime = exports.ExploreField = exports.JoinRelationship = exports.QueryField = exports.Query = exports.StringField = exports.UnsupportedField = exports.JSONField = exports.BooleanField = exports.NumberField = exports.TimestampField = exports.DateField = exports.TimestampTimeframe = exports.DateTimeframe = exports.AtomicField = exports.AtomicFieldType = exports.Explore = exports.SourceRelationship = exports.FixedConnectionMap = exports.InMemoryURLReader = exports.EmptyURLReader = exports.PreparedResult = exports.DocumentCompletion = exports.DocumentSymbol = exports.DocumentPosition = exports.DocumentRange = exports.DocumentHighlight = exports.Parse = exports.parseTableURI = exports.PreparedQuery = exports.Model = exports.MalloyError = exports.Malloy = void 0;
|
|
26
26
|
const lang_1 = require("./lang");
|
|
27
27
|
const model_1 = require("./model");
|
|
28
28
|
class Malloy {
|
|
@@ -918,6 +918,9 @@ class Explore extends Entity {
|
|
|
918
918
|
else if (fieldDef.type === "json") {
|
|
919
919
|
return [name, new JSONField(fieldDef, this, sourceField)];
|
|
920
920
|
}
|
|
921
|
+
else if (fieldDef.type === "unsupported") {
|
|
922
|
+
return [name, new UnsupportedField(fieldDef, this, sourceField)];
|
|
923
|
+
}
|
|
921
924
|
}
|
|
922
925
|
}));
|
|
923
926
|
}
|
|
@@ -1071,6 +1074,9 @@ class AtomicField extends Entity {
|
|
|
1071
1074
|
isTimestamp() {
|
|
1072
1075
|
return this instanceof TimestampField;
|
|
1073
1076
|
}
|
|
1077
|
+
isUnsupported() {
|
|
1078
|
+
return this instanceof UnsupportedField;
|
|
1079
|
+
}
|
|
1074
1080
|
get parentExplore() {
|
|
1075
1081
|
return this.parent;
|
|
1076
1082
|
}
|
|
@@ -1176,6 +1182,13 @@ class JSONField extends AtomicField {
|
|
|
1176
1182
|
}
|
|
1177
1183
|
}
|
|
1178
1184
|
exports.JSONField = JSONField;
|
|
1185
|
+
class UnsupportedField extends AtomicField {
|
|
1186
|
+
constructor(fieldUnsupportedDef, parent, source) {
|
|
1187
|
+
super(fieldUnsupportedDef, parent, source);
|
|
1188
|
+
this.fieldUnsupportedDef = fieldUnsupportedDef;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
exports.UnsupportedField = UnsupportedField;
|
|
1179
1192
|
class StringField extends AtomicField {
|
|
1180
1193
|
constructor(fieldStringDef, parent, source) {
|
|
1181
1194
|
super(fieldStringDef, parent, source);
|
|
@@ -2047,6 +2060,15 @@ class Data {
|
|
|
2047
2060
|
}
|
|
2048
2061
|
throw new Error("Not a record.");
|
|
2049
2062
|
}
|
|
2063
|
+
isUnsupported() {
|
|
2064
|
+
return this instanceof DataUnsupported;
|
|
2065
|
+
}
|
|
2066
|
+
get unsupported() {
|
|
2067
|
+
if (this.isUnsupported()) {
|
|
2068
|
+
return this;
|
|
2069
|
+
}
|
|
2070
|
+
throw new Error("Not unsupported.");
|
|
2071
|
+
}
|
|
2050
2072
|
isArray() {
|
|
2051
2073
|
return this instanceof DataArray;
|
|
2052
2074
|
}
|
|
@@ -2085,6 +2107,15 @@ class DataString extends ScalarData {
|
|
|
2085
2107
|
return this._field;
|
|
2086
2108
|
}
|
|
2087
2109
|
}
|
|
2110
|
+
class DataUnsupported extends ScalarData {
|
|
2111
|
+
constructor(value, field) {
|
|
2112
|
+
super(value, field);
|
|
2113
|
+
this._field = field;
|
|
2114
|
+
}
|
|
2115
|
+
get field() {
|
|
2116
|
+
return this._field;
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2088
2119
|
class DataBoolean extends ScalarData {
|
|
2089
2120
|
constructor(value, field) {
|
|
2090
2121
|
super(value, field);
|
|
@@ -2268,6 +2299,9 @@ class DataRecord extends Data {
|
|
|
2268
2299
|
else if (field.isString()) {
|
|
2269
2300
|
return new DataString(value, field);
|
|
2270
2301
|
}
|
|
2302
|
+
else if (field.isUnsupported()) {
|
|
2303
|
+
return new DataUnsupported(value, field);
|
|
2304
|
+
}
|
|
2271
2305
|
}
|
|
2272
2306
|
else if (field.isExploreField()) {
|
|
2273
2307
|
if (Array.isArray(value)) {
|