@malloydata/malloy 0.0.404 → 0.0.406
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/LICENSE +77 -0
- package/dist/api/asynchronous.js +2 -4
- package/dist/api/connection.js +2 -4
- package/dist/api/core.js +5 -6
- package/dist/api/foundation/annotation.js +3 -11
- package/dist/api/foundation/compile.js +15 -8
- package/dist/api/foundation/core.d.ts +44 -6
- package/dist/api/foundation/core.js +106 -31
- package/dist/api/foundation/runtime.js +9 -19
- package/dist/api/foundation/taggable.d.ts +5 -0
- package/dist/api/foundation/types.d.ts +15 -0
- package/dist/api/index.js +4 -6
- package/dist/api/sessioned.js +2 -4
- package/dist/api/stateless.js +2 -4
- package/dist/api/util.js +2 -4
- package/dist/connection/base_connection.js +2 -4
- package/dist/connection/types.d.ts +1 -3
- package/dist/connection_utils.js +2 -20
- package/dist/dialect/dialect.js +2 -20
- package/dist/dialect/dialect_map.js +2 -20
- package/dist/dialect/duckdb/dialect_functions.js +2 -4
- package/dist/dialect/duckdb/duckdb.js +2 -20
- package/dist/dialect/duckdb/function_overrides.js +2 -4
- package/dist/dialect/duckdb/index.js +2 -20
- package/dist/dialect/duckdb/table-path-parser.js +4 -4
- package/dist/dialect/functions/index.js +2 -20
- package/dist/dialect/functions/malloy_standard_functions.js +2 -4
- package/dist/dialect/functions/util.js +2 -21
- package/dist/dialect/index.js +2 -20
- package/dist/dialect/mysql/dialect_functions.js +2 -4
- package/dist/dialect/mysql/function_overrides.js +2 -4
- package/dist/dialect/mysql/index.js +2 -4
- package/dist/dialect/mysql/mysql.js +2 -20
- package/dist/dialect/pg_impl.js +2 -4
- package/dist/dialect/postgres/dialect_functions.js +2 -4
- package/dist/dialect/postgres/function_overrides.js +2 -4
- package/dist/dialect/postgres/index.js +2 -20
- package/dist/dialect/postgres/postgres.js +2 -20
- package/dist/dialect/snowflake/dialect_functions.js +2 -4
- package/dist/dialect/snowflake/function_overrides.js +2 -4
- package/dist/dialect/snowflake/index.js +2 -20
- package/dist/dialect/snowflake/snowflake.js +2 -20
- package/dist/dialect/standardsql/dialect_functions.js +2 -4
- package/dist/dialect/standardsql/function_overrides.js +2 -4
- package/dist/dialect/standardsql/index.js +2 -20
- package/dist/dialect/standardsql/standardsql.js +2 -20
- package/dist/dialect/tiny_parser.js +2 -4
- package/dist/dialect/trino/dialect_functions.js +2 -4
- package/dist/dialect/trino/function_overrides.js +2 -4
- package/dist/dialect/trino/index.js +2 -20
- package/dist/dialect/trino/trino.js +2 -20
- package/dist/index.js +4 -22
- package/dist/lang/ast/ast-utils.js +2 -20
- package/dist/lang/ast/error-factory.js +2 -20
- package/dist/lang/ast/expressions/apply.js +2 -20
- package/dist/lang/ast/expressions/binary-boolean.js +2 -20
- package/dist/lang/ast/expressions/binary-numeric.js +2 -20
- package/dist/lang/ast/expressions/boolean.js +2 -20
- package/dist/lang/ast/expressions/case.js +2 -4
- package/dist/lang/ast/expressions/constant-expression.js +2 -20
- package/dist/lang/ast/expressions/expr-add-sub.js +2 -20
- package/dist/lang/ast/expressions/expr-aggregate-function.js +2 -20
- package/dist/lang/ast/expressions/expr-alternation-tree.js +2 -20
- package/dist/lang/ast/expressions/expr-array-literal.js +2 -4
- package/dist/lang/ast/expressions/expr-asymmetric.js +2 -20
- package/dist/lang/ast/expressions/expr-avg.js +2 -20
- package/dist/lang/ast/expressions/expr-cast.js +2 -20
- package/dist/lang/ast/expressions/expr-coalesce.js +2 -20
- package/dist/lang/ast/expressions/expr-compare.js +2 -20
- package/dist/lang/ast/expressions/expr-count-distinct.js +2 -20
- package/dist/lang/ast/expressions/expr-count.js +2 -20
- package/dist/lang/ast/expressions/expr-filter-expr.js +2 -4
- package/dist/lang/ast/expressions/expr-func.js +2 -20
- package/dist/lang/ast/expressions/expr-granular-time.js +2 -20
- package/dist/lang/ast/expressions/expr-id-reference.js +2 -20
- package/dist/lang/ast/expressions/expr-logical-op.js +2 -20
- package/dist/lang/ast/expressions/expr-max.js +2 -20
- package/dist/lang/ast/expressions/expr-min.js +2 -20
- package/dist/lang/ast/expressions/expr-minus.js +2 -20
- package/dist/lang/ast/expressions/expr-mul-div.js +2 -20
- package/dist/lang/ast/expressions/expr-not.js +2 -20
- package/dist/lang/ast/expressions/expr-now.js +2 -20
- package/dist/lang/ast/expressions/expr-null.js +2 -20
- package/dist/lang/ast/expressions/expr-number.js +2 -20
- package/dist/lang/ast/expressions/expr-parens.js +2 -20
- package/dist/lang/ast/expressions/expr-props.js +2 -20
- package/dist/lang/ast/expressions/expr-record-literal.js +2 -4
- package/dist/lang/ast/expressions/expr-regex.js +2 -20
- package/dist/lang/ast/expressions/expr-string.js +4 -0
- package/dist/lang/ast/expressions/expr-sum.js +2 -20
- package/dist/lang/ast/expressions/expr-time-extract.js +2 -20
- package/dist/lang/ast/expressions/expr-time.js +2 -20
- package/dist/lang/ast/expressions/expr-ungroup.js +2 -20
- package/dist/lang/ast/expressions/for-range.js +2 -20
- package/dist/lang/ast/expressions/function-ordering.js +2 -20
- package/dist/lang/ast/expressions/grouped_by.js +2 -4
- package/dist/lang/ast/expressions/partial-compare.js +2 -20
- package/dist/lang/ast/expressions/partition_by.js +2 -20
- package/dist/lang/ast/expressions/pick-when.js +2 -20
- package/dist/lang/ast/expressions/range.js +2 -20
- package/dist/lang/ast/expressions/time-frame.js +2 -20
- package/dist/lang/ast/expressions/time-literal.js +2 -20
- package/dist/lang/ast/expressions/unary.js +2 -20
- package/dist/lang/ast/field-space/ast-view-field.js +2 -20
- package/dist/lang/ast/field-space/column-space-field.js +2 -20
- package/dist/lang/ast/field-space/def-space.js +2 -4
- package/dist/lang/ast/field-space/dynamic-space.js +2 -20
- package/dist/lang/ast/field-space/include-utils.js +2 -4
- package/dist/lang/ast/field-space/index-field-space.js +2 -20
- package/dist/lang/ast/field-space/ir-view-field.js +2 -20
- package/dist/lang/ast/field-space/join-space-field.js +2 -20
- package/dist/lang/ast/field-space/parameter-space.js +2 -4
- package/dist/lang/ast/field-space/passthrough-space.js +2 -4
- package/dist/lang/ast/field-space/permissive-space.js +2 -4
- package/dist/lang/ast/field-space/project-field-space.js +2 -20
- package/dist/lang/ast/field-space/query-input-space.js +2 -20
- package/dist/lang/ast/field-space/query-spaces.js +2 -20
- package/dist/lang/ast/field-space/reference-field.js +5 -21
- package/dist/lang/ast/field-space/refine-from-space-field.js +2 -4
- package/dist/lang/ast/field-space/refined-space.js +2 -20
- package/dist/lang/ast/field-space/rename-space-field.js +2 -20
- package/dist/lang/ast/field-space/static-space.js +2 -20
- package/dist/lang/ast/field-space/struct-space-field-base.js +2 -20
- package/dist/lang/ast/field-space/view-field.js +2 -20
- package/dist/lang/ast/index.js +2 -20
- package/dist/lang/ast/parameters/argument.js +2 -4
- package/dist/lang/ast/parameters/has-parameter.js +2 -20
- package/dist/lang/ast/query-builders/index-builder.js +2 -20
- package/dist/lang/ast/query-builders/partial-builder.js +4 -0
- package/dist/lang/ast/query-builders/project-builder.js +2 -20
- package/dist/lang/ast/query-builders/reduce-builder.js +2 -20
- package/dist/lang/ast/query-elements/anonymous-query.js +3 -21
- package/dist/lang/ast/query-elements/query-arrow.js +2 -20
- package/dist/lang/ast/query-elements/query-base.js +2 -20
- package/dist/lang/ast/query-elements/query-head-struct.js +2 -20
- package/dist/lang/ast/query-elements/query-raw.js +2 -20
- package/dist/lang/ast/query-elements/query-reference.js +2 -20
- package/dist/lang/ast/query-elements/query-refine.js +2 -20
- package/dist/lang/ast/query-items/field-declaration.js +3 -21
- package/dist/lang/ast/query-items/field-references.js +2 -20
- package/dist/lang/ast/query-items/typecheck_utils.js +2 -20
- package/dist/lang/ast/query-properties/aggregate.js +2 -20
- package/dist/lang/ast/query-properties/calculate.js +2 -20
- package/dist/lang/ast/query-properties/declare-fields.js +2 -20
- package/dist/lang/ast/query-properties/drill.js +2 -4
- package/dist/lang/ast/query-properties/extend.js +2 -20
- package/dist/lang/ast/query-properties/filters.js +2 -20
- package/dist/lang/ast/query-properties/group-by.js +2 -20
- package/dist/lang/ast/query-properties/indexing.js +2 -20
- package/dist/lang/ast/query-properties/limit.js +2 -20
- package/dist/lang/ast/query-properties/nest.js +6 -21
- package/dist/lang/ast/query-properties/nests.js +2 -20
- package/dist/lang/ast/query-properties/ordering.js +2 -20
- package/dist/lang/ast/query-properties/project-statement.js +2 -20
- package/dist/lang/ast/query-properties/qop-desc.js +2 -20
- package/dist/lang/ast/query-properties/sampling.js +2 -20
- package/dist/lang/ast/query-utils.js +2 -20
- package/dist/lang/ast/source-elements/composite-source.js +2 -4
- package/dist/lang/ast/source-elements/named-source.js +2 -23
- package/dist/lang/ast/source-elements/query-source.js +2 -22
- package/dist/lang/ast/source-elements/refined-source.js +2 -22
- package/dist/lang/ast/source-elements/source.js +2 -20
- package/dist/lang/ast/source-elements/sql-source.js +2 -25
- package/dist/lang/ast/source-elements/table-source.js +3 -22
- package/dist/lang/ast/source-elements/virtual-source.js +1 -2
- package/dist/lang/ast/source-properties/dimensions.js +2 -20
- package/dist/lang/ast/source-properties/field-list-edit.js +2 -20
- package/dist/lang/ast/source-properties/join.js +4 -26
- package/dist/lang/ast/source-properties/measures.js +2 -20
- package/dist/lang/ast/source-properties/primary-key.js +2 -20
- package/dist/lang/ast/source-properties/renames.js +3 -21
- package/dist/lang/ast/source-properties/timezone-statement.js +2 -20
- package/dist/lang/ast/source-properties/user-type-shape.js +9 -4
- package/dist/lang/ast/source-properties/view-field-declaration.js +6 -21
- package/dist/lang/ast/source-properties/views.js +2 -20
- package/dist/lang/ast/source-query-elements/include-item.js +2 -4
- package/dist/lang/ast/source-query-elements/source-query-element.js +2 -20
- package/dist/lang/ast/source-query-elements/sq-arrow.js +2 -20
- package/dist/lang/ast/source-query-elements/sq-compose.js +2 -4
- package/dist/lang/ast/source-query-elements/sq-extend.js +2 -20
- package/dist/lang/ast/source-query-elements/sq-reference.js +2 -20
- package/dist/lang/ast/source-query-elements/sq-refine.js +2 -20
- package/dist/lang/ast/source-query-elements/sq-source.js +2 -20
- package/dist/lang/ast/sql-elements/sql-string.js +2 -20
- package/dist/lang/ast/statements/define-given.js +22 -2
- package/dist/lang/ast/statements/define-query.js +3 -21
- package/dist/lang/ast/statements/define-source.js +7 -22
- package/dist/lang/ast/statements/define-user-type.js +1 -1
- package/dist/lang/ast/statements/import-statement.js +7 -20
- package/dist/lang/ast/time-utils.js +2 -20
- package/dist/lang/ast/typedesc-utils.js +2 -20
- package/dist/lang/ast/types/annotation-elements.js +2 -20
- package/dist/lang/ast/types/binary_operators.js +2 -4
- package/dist/lang/ast/types/definition-list.js +2 -20
- package/dist/lang/ast/types/dialect-name-space.js +2 -4
- package/dist/lang/ast/types/document-compile-result.js +2 -20
- package/dist/lang/ast/types/expr-result.js +2 -20
- package/dist/lang/ast/types/expr-value.js +2 -20
- package/dist/lang/ast/types/expression-def.js +2 -20
- package/dist/lang/ast/types/field-collection-member.js +2 -20
- package/dist/lang/ast/types/field-prop-statement.js +2 -20
- package/dist/lang/ast/types/field-space.js +2 -20
- package/dist/lang/ast/types/global-name-space.js +2 -20
- package/dist/lang/ast/types/granular-result.js +2 -20
- package/dist/lang/ast/types/literal.d.ts +1 -1
- package/dist/lang/ast/types/literal.js +2 -4
- package/dist/lang/ast/types/lookup-result.js +2 -20
- package/dist/lang/ast/types/malloy-element.d.ts +27 -4
- package/dist/lang/ast/types/malloy-element.js +54 -70
- package/dist/lang/ast/types/model-entry.js +2 -20
- package/dist/lang/ast/types/name-space.js +2 -20
- package/dist/lang/ast/types/noteable.js +2 -20
- package/dist/lang/ast/types/op-desc.js +2 -20
- package/dist/lang/ast/types/pipeline-comp.js +2 -20
- package/dist/lang/ast/types/query-builder.js +2 -20
- package/dist/lang/ast/types/query-comp.js +2 -20
- package/dist/lang/ast/types/query-element.js +2 -20
- package/dist/lang/ast/types/query-extend-property.js +2 -20
- package/dist/lang/ast/types/query-item.js +2 -20
- package/dist/lang/ast/types/query-property-interface.js +2 -20
- package/dist/lang/ast/types/query-property.js +2 -20
- package/dist/lang/ast/types/source-desc.js +2 -20
- package/dist/lang/ast/types/source-property.js +2 -20
- package/dist/lang/ast/types/space-entry.js +2 -20
- package/dist/lang/ast/types/space-field.js +2 -20
- package/dist/lang/ast/types/space-param.js +2 -20
- package/dist/lang/ast/types/time-result.js +2 -20
- package/dist/lang/ast/view-elements/qop-desc-view.js +2 -20
- package/dist/lang/ast/view-elements/reference-view.js +2 -20
- package/dist/lang/ast/view-elements/refine-utils.js +2 -20
- package/dist/lang/ast/view-elements/view-arrow.js +2 -20
- package/dist/lang/ast/view-elements/view-refine.js +2 -20
- package/dist/lang/ast/view-elements/view.js +2 -20
- package/dist/lang/composite-source-utils.js +2 -4
- package/dist/lang/field-utils.js +2 -20
- package/dist/lang/index.js +2 -20
- package/dist/lang/malloy-parse-info.js +2 -20
- package/dist/lang/malloy-to-ast.d.ts +1 -1
- package/dist/lang/malloy-to-ast.js +2 -21
- package/dist/lang/malloy-to-stable-query.js +2 -4
- package/dist/lang/parse-log.d.ts +5 -0
- package/dist/lang/parse-log.js +3 -20
- package/dist/lang/parse-malloy.d.ts +1 -9
- package/dist/lang/parse-malloy.js +33 -83
- package/dist/lang/parse-tree-walkers/document-completion-walker.js +2 -20
- package/dist/lang/parse-tree-walkers/document-help-context-walker.js +2 -20
- package/dist/lang/parse-tree-walkers/document-symbol-walker.js +2 -20
- package/dist/lang/parse-tree-walkers/explore-query-walker.js +2 -20
- package/dist/lang/parse-tree-walkers/find-external-references.js +2 -20
- package/dist/lang/parse-tree-walkers/find-table-path-walker.js +2 -20
- package/dist/lang/parse-utils.js +2 -20
- package/dist/lang/reference-list.js +2 -20
- package/dist/lang/run-malloy-parser.js +2 -4
- package/dist/lang/syntax-errors/custom-error-messages.js +2 -4
- package/dist/lang/syntax-errors/malloy-error-strategy.js +2 -4
- package/dist/lang/syntax-errors/malloy-parser-error-listener.js +2 -4
- package/dist/lang/test/expr-to-str.js +2 -4
- package/dist/lang/test/parse-expects.js +2 -20
- package/dist/lang/test/test-translator.js +4 -25
- package/dist/lang/translate-response.d.ts +1 -5
- package/dist/lang/translate-response.js +2 -20
- package/dist/lang/utils.js +2 -20
- package/dist/lang/zone.js +2 -20
- package/dist/model/annotation_utils.d.ts +37 -0
- package/dist/model/annotation_utils.js +85 -0
- package/dist/model/expression_compiler.js +5 -7
- package/dist/model/filter_compilers.js +2 -4
- package/dist/model/given_binding.d.ts +16 -4
- package/dist/model/given_binding.js +30 -4
- package/dist/model/index.d.ts +2 -1
- package/dist/model/index.js +6 -21
- package/dist/model/inline_expr.d.ts +10 -4
- package/dist/model/inline_expr.js +24 -26
- package/dist/model/malloy_types.d.ts +36 -7
- package/dist/model/malloy_types.js +2 -21
- package/dist/model/query_node.d.ts +0 -3
- package/dist/model/query_node.js +0 -10
- package/dist/model/query_query.js +2 -16
- package/dist/model/source_def_utils.js +0 -2
- package/dist/model/sql_block.js +2 -20
- package/dist/model/utils.d.ts +9 -2
- package/dist/model/utils.js +15 -21
- package/dist/run_sql_options.d.ts +0 -5
- package/dist/run_sql_options.js +2 -20
- package/dist/runtime_types.js +2 -20
- package/dist/test/cellsToObject.js +2 -4
- package/dist/timing.js +2 -4
- package/dist/to_stable.js +2 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/dist/lang/parse-tree-walkers/model-annotation-walker.d.ts +0 -5
- package/dist/lang/parse-tree-walkers/model-annotation-walker.js +0 -50
|
@@ -404,9 +404,6 @@ class QueryQuery extends query_node_1.QueryField {
|
|
|
404
404
|
name,
|
|
405
405
|
fields: structDef.fields,
|
|
406
406
|
...(structDef.annotations && { annotations: structDef.annotations }),
|
|
407
|
-
...(structDef.modelAnnotations && {
|
|
408
|
-
modelAnnotations: structDef.modelAnnotations,
|
|
409
|
-
}),
|
|
410
407
|
resultMetadata,
|
|
411
408
|
...(queryTimezone && { queryTimezone }),
|
|
412
409
|
};
|
|
@@ -419,9 +416,6 @@ class QueryQuery extends query_node_1.QueryField {
|
|
|
419
416
|
name,
|
|
420
417
|
fields: structDef.fields,
|
|
421
418
|
...(structDef.annotations && { annotations: structDef.annotations }),
|
|
422
|
-
...(structDef.modelAnnotations && {
|
|
423
|
-
modelAnnotations: structDef.modelAnnotations,
|
|
424
|
-
}),
|
|
425
419
|
resultMetadata,
|
|
426
420
|
...(queryTimezone && { queryTimezone }),
|
|
427
421
|
};
|
|
@@ -513,9 +507,6 @@ class QueryQuery extends query_node_1.QueryField {
|
|
|
513
507
|
resultMetadata: this.getResultMetadata(this.rootResult),
|
|
514
508
|
queryTimezone: resultStruct.getQueryInfo().queryTimezone,
|
|
515
509
|
};
|
|
516
|
-
if (this.parent.structDef.modelAnnotations) {
|
|
517
|
-
outputStruct.modelAnnotations = this.parent.structDef.modelAnnotations;
|
|
518
|
-
}
|
|
519
510
|
return outputStruct;
|
|
520
511
|
}
|
|
521
512
|
getStructSourceSQL(qs, stageWriter) {
|
|
@@ -1218,11 +1209,9 @@ class QueryQuery extends query_node_1.QueryField {
|
|
|
1218
1209
|
outputPipelinedSQL: [],
|
|
1219
1210
|
};
|
|
1220
1211
|
this.generateStage0Fields(this.rootResult, f, stageWriter);
|
|
1221
|
-
if (this.firstSegment.type === 'project'
|
|
1222
|
-
!this.parent.modelCompilerFlags().has('unsafe_complex_select_query')) {
|
|
1212
|
+
if (this.firstSegment.type === 'project') {
|
|
1223
1213
|
throw new malloy_compile_error_1.MalloyCompileError("Cannot use 'select:' in a stage that contains nested views. " +
|
|
1224
|
-
'Use `group_by:` or restructure the pipeline. '
|
|
1225
|
-
'Set `##! unsafe_complex_select_query` to bypass at your own risk.', 'compiler-project-with-turtles', this.fieldDef.location);
|
|
1214
|
+
'Use `group_by:` or restructure the pipeline.', 'compiler-project-with-turtles', this.fieldDef.location);
|
|
1226
1215
|
}
|
|
1227
1216
|
const groupBy = 'GROUP BY ' + f.dimensionIndexes.join(',') + '\n';
|
|
1228
1217
|
from += this.parent.dialect.sqlGroupSetTable(this.maxGroupSet) + '\n';
|
|
@@ -1821,9 +1810,6 @@ class QueryQueryIndex extends QueryQuery {
|
|
|
1821
1810
|
],
|
|
1822
1811
|
connection: this.parent.connectionName,
|
|
1823
1812
|
};
|
|
1824
|
-
if (this.parent.structDef.modelAnnotations) {
|
|
1825
|
-
ret.modelAnnotations = this.parent.structDef.modelAnnotations;
|
|
1826
|
-
}
|
|
1827
1813
|
return ret;
|
|
1828
1814
|
}
|
|
1829
1815
|
}
|
|
@@ -45,7 +45,6 @@ function mkQuerySourceDef(base, query, name) {
|
|
|
45
45
|
location: base.location,
|
|
46
46
|
// StructDefBase
|
|
47
47
|
annotations: base.annotations,
|
|
48
|
-
modelAnnotations: base.modelAnnotations,
|
|
49
48
|
fields: base.fields,
|
|
50
49
|
// Filtered
|
|
51
50
|
filterList: base.filterList,
|
|
@@ -84,7 +83,6 @@ function mkSQLSourceDef(base, selectStr, selectSegments) {
|
|
|
84
83
|
location: base.location,
|
|
85
84
|
// StructDefBase
|
|
86
85
|
annotations: base.annotations,
|
|
87
|
-
modelAnnotations: base.modelAnnotations,
|
|
88
86
|
fields: base.fields,
|
|
89
87
|
// Filtered
|
|
90
88
|
filterList: base.filterList,
|
package/dist/model/sql_block.js
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright
|
|
4
|
-
*
|
|
5
|
-
* Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
* a copy of this software and associated documentation files
|
|
7
|
-
* (the "Software"), to deal in the Software without restriction,
|
|
8
|
-
* including without limitation the rights to use, copy, modify, merge,
|
|
9
|
-
* publish, distribute, sublicense, and/or sell copies of the Software,
|
|
10
|
-
* and to permit persons to whom the Software is furnished to do so,
|
|
11
|
-
* subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be
|
|
14
|
-
* included in all copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
-
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
-
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
-
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
-
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
3
|
+
* Copyright Contributors to the Malloy project
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
23
5
|
*/
|
|
24
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
7
|
exports.getSourceRequest = getSourceRequest;
|
package/dist/model/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AtomicTypeDef, Expr, FieldDef, GenericSQLExpr, GivenTypeDef, ModelDef, StructDef } from './malloy_types';
|
|
1
|
+
import type { AtomicTypeDef, Expr, FieldDef, GenericSQLExpr, GivenTypeDef, ModelDef, ModelID, StructDef } from './malloy_types';
|
|
2
2
|
import type { DialectFieldList } from '../dialect';
|
|
3
3
|
/**
|
|
4
4
|
* Format a typeDef as user-readable Malloy type syntax. Used in error
|
|
@@ -74,8 +74,15 @@ export declare class GenerateState {
|
|
|
74
74
|
withApply(s: string): GenerateState;
|
|
75
75
|
withTotal(groupSet: number): GenerateState;
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Make a {@link ModelID} for a model. Pass the model's URL for a real model;
|
|
79
|
+
* omit it for a URL-less model to get a synthetic `"internal <uuid>"` id. The
|
|
80
|
+
* space makes the synthetic form an illegal URL so it can never collide with a
|
|
81
|
+
* real model URL.
|
|
82
|
+
*/
|
|
83
|
+
export declare function mkModelID(url?: string): ModelID;
|
|
77
84
|
/**
|
|
78
85
|
* Create an empty ModelDef with the given name.
|
|
79
86
|
* Use this factory to ensure all required fields are present.
|
|
80
87
|
*/
|
|
81
|
-
export declare function mkModelDef(name: string): ModelDef;
|
|
88
|
+
export declare function mkModelDef(name: string, modelID?: ModelID): ModelDef;
|
package/dist/model/utils.js
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright
|
|
4
|
-
*
|
|
5
|
-
* Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
* a copy of this software and associated documentation files
|
|
7
|
-
* (the "Software"), to deal in the Software without restriction,
|
|
8
|
-
* including without limitation the rights to use, copy, modify, merge,
|
|
9
|
-
* publish, distribute, sublicense, and/or sell copies of the Software,
|
|
10
|
-
* and to permit persons to whom the Software is furnished to do so,
|
|
11
|
-
* subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be
|
|
14
|
-
* included in all copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
-
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
-
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
-
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
-
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
3
|
+
* Copyright Contributors to the Malloy project
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
23
5
|
*/
|
|
24
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
7
|
exports.GenerateState = exports.AndChain = void 0;
|
|
@@ -38,6 +20,7 @@ exports.getDialectFieldList = getDialectFieldList;
|
|
|
38
20
|
exports.pathToKey = pathToKey;
|
|
39
21
|
exports.groupingKey = groupingKey;
|
|
40
22
|
exports.caseGroup = caseGroup;
|
|
23
|
+
exports.mkModelID = mkModelID;
|
|
41
24
|
exports.mkModelDef = mkModelDef;
|
|
42
25
|
const uuid_1 = require("uuid");
|
|
43
26
|
const sha256_1 = require("@noble/hashes/sha256");
|
|
@@ -326,16 +309,27 @@ class GenerateState {
|
|
|
326
309
|
}
|
|
327
310
|
}
|
|
328
311
|
exports.GenerateState = GenerateState;
|
|
312
|
+
/**
|
|
313
|
+
* Make a {@link ModelID} for a model. Pass the model's URL for a real model;
|
|
314
|
+
* omit it for a URL-less model to get a synthetic `"internal <uuid>"` id. The
|
|
315
|
+
* space makes the synthetic form an illegal URL so it can never collide with a
|
|
316
|
+
* real model URL.
|
|
317
|
+
*/
|
|
318
|
+
function mkModelID(url) {
|
|
319
|
+
return url !== null && url !== void 0 ? url : `internal ${(0, uuid_1.v4)()}`;
|
|
320
|
+
}
|
|
329
321
|
/**
|
|
330
322
|
* Create an empty ModelDef with the given name.
|
|
331
323
|
* Use this factory to ensure all required fields are present.
|
|
332
324
|
*/
|
|
333
|
-
function mkModelDef(name) {
|
|
325
|
+
function mkModelDef(name, modelID = mkModelID()) {
|
|
334
326
|
return {
|
|
335
327
|
name,
|
|
328
|
+
modelID,
|
|
336
329
|
exports: [],
|
|
337
330
|
contents: (0, malloy_types_1.mkSafeRecord)(),
|
|
338
331
|
sourceRegistry: {},
|
|
332
|
+
modelAnnotations: {},
|
|
339
333
|
queryList: [],
|
|
340
334
|
dependencies: {},
|
|
341
335
|
};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import type { AnnotationsDef } from './model/malloy_types';
|
|
2
1
|
export interface RunSQLOptions {
|
|
3
2
|
rowLimit?: number;
|
|
4
3
|
abortSignal?: AbortSignal;
|
|
5
|
-
/** Model annotations forwarded to the adapter (e.g. `##!` dialect flags). */
|
|
6
|
-
modelAnnotations?: AnnotationsDef;
|
|
7
|
-
/** Query annotations forwarded to the adapter. */
|
|
8
|
-
queryAnnotations?: AnnotationsDef;
|
|
9
4
|
}
|
|
10
5
|
export type QueryOptionsReader = RunSQLOptions | (() => RunSQLOptions);
|
package/dist/run_sql_options.js
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright
|
|
4
|
-
*
|
|
5
|
-
* Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
* a copy of this software and associated documentation files
|
|
7
|
-
* (the "Software"), to deal in the Software without restriction,
|
|
8
|
-
* including without limitation the rights to use, copy, modify, merge,
|
|
9
|
-
* publish, distribute, sublicense, and/or sell copies of the Software,
|
|
10
|
-
* and to permit persons to whom the Software is furnished to do so,
|
|
11
|
-
* subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be
|
|
14
|
-
* included in all copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
-
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
-
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
-
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
-
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
3
|
+
* Copyright Contributors to the Malloy project
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
23
5
|
*/
|
|
24
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
7
|
//# sourceMappingURL=run_sql_options.js.map
|
package/dist/runtime_types.js
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright
|
|
4
|
-
*
|
|
5
|
-
* Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
* a copy of this software and associated documentation files
|
|
7
|
-
* (the "Software"), to deal in the Software without restriction,
|
|
8
|
-
* including without limitation the rights to use, copy, modify, merge,
|
|
9
|
-
* publish, distribute, sublicense, and/or sell copies of the Software,
|
|
10
|
-
* and to permit persons to whom the Software is furnished to do so,
|
|
11
|
-
* subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be
|
|
14
|
-
* included in all copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
-
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
-
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
-
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
-
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
3
|
+
* Copyright Contributors to the Malloy project
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
23
5
|
*/
|
|
24
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
7
|
//# sourceMappingURL=runtime_types.js.map
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
3
|
+
* Copyright Contributors to the Malloy project
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
7
5
|
*/
|
|
8
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
7
|
exports.cellsToObjects = cellsToObjects;
|
package/dist/timing.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
3
|
+
* Copyright Contributors to the Malloy project
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
7
5
|
*/
|
|
8
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
7
|
exports.Timer = void 0;
|
package/dist/to_stable.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
3
|
+
* Copyright Contributors to the Malloy project
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
7
5
|
*/
|
|
8
6
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
7
|
if (k2 === undefined) k2 = k;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const MALLOY_VERSION = "0.0.
|
|
1
|
+
export declare const MALLOY_VERSION = "0.0.406";
|
package/dist/version.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MALLOY_VERSION = void 0;
|
|
4
4
|
// generated with 'generate-version-file' script; do not edit manually
|
|
5
|
-
exports.MALLOY_VERSION = '0.0.
|
|
5
|
+
exports.MALLOY_VERSION = '0.0.406';
|
|
6
6
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/malloy",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.406",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"generate-version-file": "VERSION=$(npm pkg get version --workspaces=false | tr -d \\\")\necho \"// generated with 'generate-version-file' script; do not edit manually\\nexport const MALLOY_VERSION = '$VERSION';\" > src/version.ts"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@malloydata/malloy-filter": "0.0.
|
|
55
|
-
"@malloydata/malloy-interfaces": "0.0.
|
|
56
|
-
"@malloydata/malloy-tag": "0.0.
|
|
54
|
+
"@malloydata/malloy-filter": "0.0.406",
|
|
55
|
+
"@malloydata/malloy-interfaces": "0.0.406",
|
|
56
|
+
"@malloydata/malloy-tag": "0.0.406",
|
|
57
57
|
"@noble/hashes": "^1.8.0",
|
|
58
58
|
"antlr4ts": "^0.5.0-alpha.4",
|
|
59
59
|
"assert": "^2.0.0",
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { CommonTokenStream } from 'antlr4ts';
|
|
2
|
-
import type { MalloyTranslation } from '../parse-malloy';
|
|
3
|
-
import type { AnnotationsDef } from '../../model/malloy_types';
|
|
4
|
-
import type { MalloyParseInfo } from '../malloy-parse-info';
|
|
5
|
-
export declare function walkForModelAnnotation(forParse: MalloyTranslation, tokens: CommonTokenStream, parseInfo: MalloyParseInfo): AnnotationsDef;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright 2023 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
* a copy of this software and associated documentation files
|
|
7
|
-
* (the "Software"), to deal in the Software without restriction,
|
|
8
|
-
* including without limitation the rights to use, copy, modify, merge,
|
|
9
|
-
* publish, distribute, sublicense, and/or sell copies of the Software,
|
|
10
|
-
* and to permit persons to whom the Software is furnished to do so,
|
|
11
|
-
* subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be
|
|
14
|
-
* included in all copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
-
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
-
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
-
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
-
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.walkForModelAnnotation = walkForModelAnnotation;
|
|
26
|
-
const ParseTreeWalker_1 = require("antlr4ts/tree/ParseTreeWalker");
|
|
27
|
-
const parse_utils_1 = require("../parse-utils");
|
|
28
|
-
class ModelAnnotationWalker {
|
|
29
|
-
constructor(translator, tokens, parseInfo) {
|
|
30
|
-
this.translator = translator;
|
|
31
|
-
this.tokens = tokens;
|
|
32
|
-
this.parseInfo = parseInfo;
|
|
33
|
-
this.notes = [];
|
|
34
|
-
}
|
|
35
|
-
enterDocAnnotations(pcx) {
|
|
36
|
-
for (const a of pcx.docAnnotation()) {
|
|
37
|
-
this.notes.push((0, parse_utils_1.noteFromAnnotation)(a, this.parseInfo));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
get annotations() {
|
|
41
|
-
return { notes: this.notes };
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function walkForModelAnnotation(forParse, tokens, parseInfo) {
|
|
45
|
-
const finder = new ModelAnnotationWalker(forParse, tokens, parseInfo);
|
|
46
|
-
const listener = finder;
|
|
47
|
-
ParseTreeWalker_1.ParseTreeWalker.DEFAULT.walk(listener, parseInfo.root);
|
|
48
|
-
return finder.annotations;
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=model-annotation-walker.js.map
|