@malloydata/malloy 0.0.195-dev241003204819 → 0.0.195-dev241007154000
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/connection/base_connection.d.ts +21 -7
- package/dist/connection/base_connection.js +62 -0
- package/dist/connection/types.d.ts +5 -5
- package/dist/dialect/dialect.d.ts +5 -3
- package/dist/dialect/dialect.js +15 -0
- package/dist/dialect/duckdb/duckdb.d.ts +3 -3
- package/dist/dialect/duckdb/duckdb.js +8 -3
- package/dist/dialect/postgres/postgres.d.ts +3 -3
- package/dist/dialect/postgres/postgres.js +5 -2
- package/dist/dialect/snowflake/snowflake.d.ts +3 -3
- package/dist/dialect/snowflake/snowflake.js +4 -1
- package/dist/dialect/standardsql/standardsql.d.ts +3 -3
- package/dist/dialect/standardsql/standardsql.js +5 -2
- package/dist/dialect/trino/trino.d.ts +3 -3
- package/dist/dialect/trino/trino.js +35 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -2
- package/dist/lang/ast/error-factory.d.ts +4 -3
- package/dist/lang/ast/error-factory.js +27 -17
- package/dist/lang/ast/expressions/constant-expression.d.ts +1 -0
- package/dist/lang/ast/expressions/constant-expression.js +3 -0
- package/dist/lang/ast/expressions/expr-aggregate-function.d.ts +3 -7
- package/dist/lang/ast/expressions/expr-aggregate-function.js +50 -54
- package/dist/lang/ast/expressions/expr-cast.js +2 -4
- package/dist/lang/ast/expressions/expr-func.js +1 -1
- package/dist/lang/ast/expressions/expr-granular-time.js +1 -1
- package/dist/lang/ast/expressions/expr-record-literal.d.ts +16 -0
- package/dist/lang/ast/expressions/expr-record-literal.js +57 -0
- package/dist/lang/ast/expressions/expr-time-extract.js +3 -3
- package/dist/lang/ast/expressions/expr-time.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-time.js +1 -1
- package/dist/lang/ast/expressions/time-literal.d.ts +6 -6
- package/dist/lang/ast/expressions/time-literal.js +1 -1
- package/dist/lang/ast/field-space/column-space-field.d.ts +6 -5
- package/dist/lang/ast/field-space/column-space-field.js +7 -4
- package/dist/lang/ast/field-space/dynamic-space.d.ts +8 -6
- package/dist/lang/ast/field-space/dynamic-space.js +35 -11
- package/dist/lang/ast/field-space/index-field-space.js +6 -3
- package/dist/lang/ast/field-space/ir-view-field.d.ts +1 -0
- package/dist/lang/ast/field-space/ir-view-field.js +3 -1
- package/dist/lang/ast/field-space/join-space-field.d.ts +2 -2
- package/dist/lang/ast/field-space/join-space-field.js +2 -2
- package/dist/lang/ast/field-space/parameter-space.d.ts +1 -0
- package/dist/lang/ast/field-space/parameter-space.js +4 -1
- package/dist/lang/ast/field-space/query-input-space.d.ts +4 -4
- package/dist/lang/ast/field-space/query-input-space.js +3 -5
- package/dist/lang/ast/field-space/query-spaces.d.ts +4 -4
- package/dist/lang/ast/field-space/query-spaces.js +1 -1
- package/dist/lang/ast/field-space/reference-field.js +10 -8
- package/dist/lang/ast/field-space/refined-space.d.ts +2 -2
- package/dist/lang/ast/field-space/static-space.d.ts +14 -5
- package/dist/lang/ast/field-space/static-space.js +45 -20
- package/dist/lang/ast/field-space/struct-space-field-base.d.ts +6 -5
- package/dist/lang/ast/field-space/struct-space-field-base.js +12 -4
- package/dist/lang/ast/index.d.ts +2 -1
- package/dist/lang/ast/index.js +2 -1
- package/dist/lang/ast/query-builders/index-builder.d.ts +2 -2
- package/dist/lang/ast/query-builders/project-builder.d.ts +2 -2
- package/dist/lang/ast/query-builders/reduce-builder.d.ts +2 -2
- package/dist/lang/ast/query-elements/query-arrow.js +2 -2
- package/dist/lang/ast/query-elements/query-head-struct.d.ts +2 -2
- package/dist/lang/ast/query-elements/query-head-struct.js +2 -2
- package/dist/lang/ast/query-elements/query-raw.js +2 -2
- package/dist/lang/ast/query-elements/query-reference.js +1 -1
- package/dist/lang/ast/query-items/field-declaration.d.ts +8 -6
- package/dist/lang/ast/query-items/field-declaration.js +66 -24
- package/dist/lang/ast/query-properties/qop-desc.d.ts +2 -2
- package/dist/lang/ast/query-properties/qop-desc.js +1 -1
- package/dist/lang/ast/source-elements/named-source.d.ts +4 -4
- package/dist/lang/ast/source-elements/named-source.js +16 -8
- package/dist/lang/ast/source-elements/query-source.d.ts +3 -3
- package/dist/lang/ast/source-elements/query-source.js +5 -2
- package/dist/lang/ast/source-elements/refined-source.d.ts +3 -3
- package/dist/lang/ast/source-elements/refined-source.js +4 -4
- package/dist/lang/ast/source-elements/source.d.ts +2 -2
- package/dist/lang/ast/source-elements/source.js +2 -2
- package/dist/lang/ast/source-elements/sql-source.d.ts +4 -4
- package/dist/lang/ast/source-elements/sql-source.js +6 -6
- package/dist/lang/ast/source-elements/table-source.d.ts +2 -2
- package/dist/lang/ast/source-elements/table-source.js +1 -1
- package/dist/lang/ast/source-properties/{joins.d.ts → join.d.ts} +11 -14
- package/dist/lang/ast/source-properties/{joins.js → join.js} +35 -52
- package/dist/lang/ast/source-query-elements/sq-reference.js +6 -5
- package/dist/lang/ast/sql-elements/sql-string.d.ts +2 -2
- package/dist/lang/ast/statements/define-source.js +1 -1
- package/dist/lang/ast/struct-utils.d.ts +3 -3
- package/dist/lang/ast/struct-utils.js +12 -3
- package/dist/lang/ast/time-utils.d.ts +3 -3
- package/dist/lang/ast/types/document-compile-result.d.ts +2 -2
- package/dist/lang/ast/types/expression-def.js +4 -4
- package/dist/lang/ast/types/field-space.d.ts +8 -3
- package/dist/lang/ast/types/lookup-result.d.ts +8 -5
- package/dist/lang/ast/types/malloy-element.d.ts +3 -3
- package/dist/lang/ast/types/malloy-element.js +10 -21
- package/dist/lang/ast/types/op-desc.d.ts +2 -2
- package/dist/lang/ast/types/pipeline-comp.d.ts +2 -2
- package/dist/lang/ast/types/query-comp.d.ts +3 -3
- package/dist/lang/ast/types/query-extend-property.d.ts +1 -2
- package/dist/lang/ast/types/query-extend-property.js +4 -2
- package/dist/lang/ast/types/source-property.d.ts +2 -2
- package/dist/lang/ast/types/source-property.js +2 -2
- package/dist/lang/ast/types/space-field.d.ts +10 -3
- package/dist/lang/ast/types/space-field.js +11 -2
- package/dist/lang/ast/types/time-result.d.ts +2 -2
- package/dist/lang/ast/view-elements/qop-desc-view.d.ts +3 -3
- package/dist/lang/ast/view-elements/qop-desc-view.js +1 -1
- package/dist/lang/ast/view-elements/reference-view.d.ts +4 -4
- package/dist/lang/ast/view-elements/reference-view.js +2 -6
- package/dist/lang/ast/view-elements/view-refine.d.ts +2 -2
- package/dist/lang/index.d.ts +1 -1
- package/dist/lang/lib/Malloy/MalloyParser.d.ts +54 -21
- package/dist/lang/lib/Malloy/MalloyParser.js +1647 -1457
- package/dist/lang/lib/Malloy/MalloyParserListener.d.ts +57 -9
- package/dist/lang/lib/Malloy/MalloyParserVisitor.d.ts +35 -5
- package/dist/lang/malloy-to-ast.d.ts +4 -4
- package/dist/lang/malloy-to-ast.js +32 -4
- package/dist/lang/parse-log.d.ts +5 -9
- package/dist/lang/parse-malloy.d.ts +10 -10
- package/dist/lang/parse-malloy.js +2 -1
- package/dist/lang/test/annotation.spec.js +7 -1
- package/dist/lang/test/field-symbols.spec.js +21 -25
- package/dist/lang/test/imports.spec.js +12 -10
- package/dist/lang/test/lenses.spec.js +2 -2
- package/dist/lang/test/model_serialization.spec.d.ts +4 -4
- package/dist/lang/test/model_serialization.spec.js +19 -31
- package/dist/lang/test/parse.spec.js +3 -4
- package/dist/lang/test/query.spec.js +3 -2
- package/dist/lang/test/source.spec.js +7 -0
- package/dist/lang/test/sql-block.spec.js +8 -19
- package/dist/lang/test/test-translator.d.ts +4 -4
- package/dist/lang/test/test-translator.js +53 -61
- package/dist/lang/translate-response.d.ts +3 -3
- package/dist/malloy.d.ts +31 -149
- package/dist/malloy.js +111 -269
- package/dist/model/malloy_query.d.ts +25 -23
- package/dist/model/malloy_query.js +262 -323
- package/dist/model/malloy_types.d.ts +145 -155
- package/dist/model/malloy_types.js +81 -84
- package/dist/model/sql_block.d.ts +4 -4
- package/dist/model/sql_block.js +9 -12
- package/dist/tags.js +2 -2
- package/dist/version.d.ts +1 -0
- package/dist/version.js +6 -0
- package/package.json +3 -2
- package/dist/lang/ast/space-seed.d.ts +0 -16
- package/dist/lang/ast/space-seed.js +0 -59
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PipeSegment } from '../../../model/malloy_types';
|
|
2
2
|
import { QueryOperationSpace } from '../field-space/query-spaces';
|
|
3
3
|
import { QOpDesc } from '../query-properties/qop-desc';
|
|
4
|
-
import {
|
|
4
|
+
import { SourceFieldSpace } from '../types/field-space';
|
|
5
5
|
import { PipelineComp } from '../types/pipeline-comp';
|
|
6
6
|
import { View } from './view';
|
|
7
7
|
/**
|
|
@@ -13,8 +13,8 @@ export declare class QOpDescView extends View {
|
|
|
13
13
|
readonly operation: QOpDesc;
|
|
14
14
|
elementType: string;
|
|
15
15
|
constructor(operation: QOpDesc);
|
|
16
|
-
pipelineComp(fs:
|
|
16
|
+
pipelineComp(fs: SourceFieldSpace, isNestIn?: QueryOperationSpace): PipelineComp;
|
|
17
17
|
private getOp;
|
|
18
|
-
refine(inputFS:
|
|
18
|
+
refine(inputFS: SourceFieldSpace, _pipeline: PipeSegment[], isNestIn: QueryOperationSpace | undefined): PipeSegment[];
|
|
19
19
|
getImplicitName(): string | undefined;
|
|
20
20
|
}
|
|
@@ -89,7 +89,7 @@ class QOpDescView extends view_1.View {
|
|
|
89
89
|
const last = pipeline.length - 1;
|
|
90
90
|
this.has({ tailRefinements });
|
|
91
91
|
const finalIn = (0, struct_utils_1.getFinalStruct)(this, inputFS.structDef(), pipeline.slice(-1));
|
|
92
|
-
pipeline[last] = this.getOp(new static_space_1.
|
|
92
|
+
pipeline[last] = this.getOp(new static_space_1.StaticSourceSpace(finalIn), undefined, tailRefinements, pipeline[last]);
|
|
93
93
|
}
|
|
94
94
|
return pipeline;
|
|
95
95
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PipeSegment } from '../../../model/malloy_types';
|
|
2
2
|
import { QueryOperationSpace } from '../field-space/query-spaces';
|
|
3
3
|
import { ViewOrScalarFieldReference } from '../query-items/field-references';
|
|
4
|
-
import {
|
|
4
|
+
import { SourceFieldSpace } from '../types/field-space';
|
|
5
5
|
import { PipelineComp } from '../types/pipeline-comp';
|
|
6
6
|
import { View } from './view';
|
|
7
7
|
/**
|
|
@@ -16,13 +16,13 @@ export declare class ReferenceView extends View {
|
|
|
16
16
|
readonly reference: ViewOrScalarFieldReference;
|
|
17
17
|
elementType: string;
|
|
18
18
|
constructor(reference: ViewOrScalarFieldReference);
|
|
19
|
-
pipelineComp(fs:
|
|
20
|
-
_pipelineComp(fs:
|
|
19
|
+
pipelineComp(fs: SourceFieldSpace, _isNestIn: QueryOperationSpace): PipelineComp;
|
|
20
|
+
_pipelineComp(fs: SourceFieldSpace, { forRefinement }?: {
|
|
21
21
|
forRefinement: boolean;
|
|
22
22
|
}): PipelineComp & {
|
|
23
23
|
error?: boolean;
|
|
24
24
|
};
|
|
25
25
|
private getRefinementSegment;
|
|
26
|
-
refine(inputFS:
|
|
26
|
+
refine(inputFS: SourceFieldSpace, pipeline: PipeSegment[], _isNestIn: QueryOperationSpace | undefined): PipeSegment[];
|
|
27
27
|
getImplicitName(): string | undefined;
|
|
28
28
|
}
|
|
@@ -75,16 +75,12 @@ class ReferenceView extends view_1.View {
|
|
|
75
75
|
type: 'reduce',
|
|
76
76
|
queryFields: [this.reference.refToField],
|
|
77
77
|
};
|
|
78
|
-
const { dialect, queryTimezone, structRelationship } = fs.structDef();
|
|
79
78
|
const name = this.reference.nameString;
|
|
80
79
|
const outputStruct = {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
queryTimezone,
|
|
80
|
+
...(0, malloy_types_1.sourceBase)(fs.structDef()),
|
|
81
|
+
type: 'query_result',
|
|
84
82
|
name,
|
|
85
83
|
fields: [fieldDef],
|
|
86
|
-
structRelationship,
|
|
87
|
-
structSource: { type: 'query_result' },
|
|
88
84
|
};
|
|
89
85
|
return {
|
|
90
86
|
pipeline: [newSegment],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PipeSegment } from '../../../model';
|
|
2
2
|
import { QueryOperationSpace } from '../field-space/query-spaces';
|
|
3
|
-
import { FieldSpace } from '../types/field-space';
|
|
3
|
+
import { FieldSpace, SourceFieldSpace } from '../types/field-space';
|
|
4
4
|
import { PipelineComp } from '../types/pipeline-comp';
|
|
5
5
|
import { View } from './view';
|
|
6
6
|
/**
|
|
@@ -14,7 +14,7 @@ export declare class ViewRefine extends View {
|
|
|
14
14
|
readonly refinement: View;
|
|
15
15
|
elementType: string;
|
|
16
16
|
constructor(base: View, refinement: View);
|
|
17
|
-
pipelineComp(fs:
|
|
17
|
+
pipelineComp(fs: SourceFieldSpace, isNestIn?: QueryOperationSpace): PipelineComp;
|
|
18
18
|
refine(inputFS: FieldSpace, pipeline: PipeSegment[], isNestIn: QueryOperationSpace | undefined): PipeSegment[];
|
|
19
19
|
getImplicitName(): string | undefined;
|
|
20
20
|
}
|
package/dist/lang/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { MalloyTranslator } from './parse-malloy';
|
|
2
|
-
export type { UpdateData, SchemaData, URLData, SQLBlockData, } from './parse-malloy';
|
|
2
|
+
export type { UpdateData, SchemaData, URLData, SQLSources as SQLBlockData, } from './parse-malloy';
|
|
3
3
|
export type { TranslateResponse } from './translate-response';
|
|
4
4
|
export { exploreQueryWalkerBuilder } from './parse-tree-walkers/explore-query-walker';
|
|
5
5
|
export type { ExploreClauseRef } from './parse-tree-walkers/explore-query-walker';
|
|
@@ -281,22 +281,24 @@ export declare class MalloyParser extends Parser {
|
|
|
281
281
|
static readonly RULE_partialAllowedFieldExpr = 115;
|
|
282
282
|
static readonly RULE_pickStatement = 116;
|
|
283
283
|
static readonly RULE_pick = 117;
|
|
284
|
-
static readonly
|
|
285
|
-
static readonly
|
|
286
|
-
static readonly
|
|
287
|
-
static readonly
|
|
288
|
-
static readonly
|
|
289
|
-
static readonly
|
|
290
|
-
static readonly
|
|
291
|
-
static readonly
|
|
292
|
-
static readonly
|
|
293
|
-
static readonly
|
|
294
|
-
static readonly
|
|
295
|
-
static readonly
|
|
296
|
-
static readonly
|
|
297
|
-
static readonly
|
|
298
|
-
static readonly
|
|
299
|
-
static readonly
|
|
284
|
+
static readonly RULE_recordKey = 118;
|
|
285
|
+
static readonly RULE_recordElement = 119;
|
|
286
|
+
static readonly RULE_argumentList = 120;
|
|
287
|
+
static readonly RULE_fieldNameList = 121;
|
|
288
|
+
static readonly RULE_fieldCollection = 122;
|
|
289
|
+
static readonly RULE_collectionWildCard = 123;
|
|
290
|
+
static readonly RULE_starQualified = 124;
|
|
291
|
+
static readonly RULE_taggedRef = 125;
|
|
292
|
+
static readonly RULE_refExpr = 126;
|
|
293
|
+
static readonly RULE_collectionMember = 127;
|
|
294
|
+
static readonly RULE_fieldPath = 128;
|
|
295
|
+
static readonly RULE_joinName = 129;
|
|
296
|
+
static readonly RULE_fieldName = 130;
|
|
297
|
+
static readonly RULE_justExpr = 131;
|
|
298
|
+
static readonly RULE_sqlExploreNameRef = 132;
|
|
299
|
+
static readonly RULE_nameSQLBlock = 133;
|
|
300
|
+
static readonly RULE_connectionName = 134;
|
|
301
|
+
static readonly RULE_experimentalStatementForTesting = 135;
|
|
300
302
|
static readonly ruleNames: string[];
|
|
301
303
|
private static readonly _LITERAL_NAMES;
|
|
302
304
|
private static readonly _SYMBOLIC_NAMES;
|
|
@@ -428,6 +430,8 @@ export declare class MalloyParser extends Parser {
|
|
|
428
430
|
partialAllowedFieldExpr(): PartialAllowedFieldExprContext;
|
|
429
431
|
pickStatement(): PickStatementContext;
|
|
430
432
|
pick(): PickContext;
|
|
433
|
+
recordKey(): RecordKeyContext;
|
|
434
|
+
recordElement(): RecordElementContext;
|
|
431
435
|
argumentList(): ArgumentListContext;
|
|
432
436
|
fieldNameList(): FieldNameListContext;
|
|
433
437
|
fieldCollection(): FieldCollectionContext;
|
|
@@ -1996,16 +2000,16 @@ export declare class ExprFieldPathContext extends FieldExprContext {
|
|
|
1996
2000
|
exitRule(listener: MalloyParserListener): void;
|
|
1997
2001
|
accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
|
|
1998
2002
|
}
|
|
1999
|
-
export declare class
|
|
2000
|
-
|
|
2001
|
-
fieldProperties(): FieldPropertiesContext;
|
|
2003
|
+
export declare class ExprLiteralContext extends FieldExprContext {
|
|
2004
|
+
literal(): LiteralContext;
|
|
2002
2005
|
constructor(ctx: FieldExprContext);
|
|
2003
2006
|
enterRule(listener: MalloyParserListener): void;
|
|
2004
2007
|
exitRule(listener: MalloyParserListener): void;
|
|
2005
2008
|
accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
|
|
2006
2009
|
}
|
|
2007
|
-
export declare class
|
|
2008
|
-
|
|
2010
|
+
export declare class ExprFieldPropsContext extends FieldExprContext {
|
|
2011
|
+
fieldExpr(): FieldExprContext;
|
|
2012
|
+
fieldProperties(): FieldPropertiesContext;
|
|
2009
2013
|
constructor(ctx: FieldExprContext);
|
|
2010
2014
|
enterRule(listener: MalloyParserListener): void;
|
|
2011
2015
|
exitRule(listener: MalloyParserListener): void;
|
|
@@ -2307,6 +2311,35 @@ export declare class PickContext extends ParserRuleContext {
|
|
|
2307
2311
|
exitRule(listener: MalloyParserListener): void;
|
|
2308
2312
|
accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
|
|
2309
2313
|
}
|
|
2314
|
+
export declare class RecordKeyContext extends ParserRuleContext {
|
|
2315
|
+
id(): IdContext;
|
|
2316
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
2317
|
+
get ruleIndex(): number;
|
|
2318
|
+
enterRule(listener: MalloyParserListener): void;
|
|
2319
|
+
exitRule(listener: MalloyParserListener): void;
|
|
2320
|
+
accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
|
|
2321
|
+
}
|
|
2322
|
+
export declare class RecordElementContext extends ParserRuleContext {
|
|
2323
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number);
|
|
2324
|
+
get ruleIndex(): number;
|
|
2325
|
+
copyFrom(ctx: RecordElementContext): void;
|
|
2326
|
+
}
|
|
2327
|
+
export declare class RecordRefContext extends RecordElementContext {
|
|
2328
|
+
fieldPath(): FieldPathContext;
|
|
2329
|
+
constructor(ctx: RecordElementContext);
|
|
2330
|
+
enterRule(listener: MalloyParserListener): void;
|
|
2331
|
+
exitRule(listener: MalloyParserListener): void;
|
|
2332
|
+
accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
|
|
2333
|
+
}
|
|
2334
|
+
export declare class RecordExprContext extends RecordElementContext {
|
|
2335
|
+
recordKey(): RecordKeyContext;
|
|
2336
|
+
IS(): TerminalNode;
|
|
2337
|
+
fieldExpr(): FieldExprContext;
|
|
2338
|
+
constructor(ctx: RecordElementContext);
|
|
2339
|
+
enterRule(listener: MalloyParserListener): void;
|
|
2340
|
+
exitRule(listener: MalloyParserListener): void;
|
|
2341
|
+
accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
|
|
2342
|
+
}
|
|
2310
2343
|
export declare class ArgumentListContext extends ParserRuleContext {
|
|
2311
2344
|
fieldExpr(): FieldExprContext[];
|
|
2312
2345
|
fieldExpr(i: number): FieldExprContext;
|