@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
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.PreparedResult = exports.PreparedQuery = exports.Given = exports.PersistSource = exports.Model = exports.Reference = exports.ExploreField = exports.QueryField = exports.Query = exports.StringField = exports.UnsupportedField = exports.JSONField = exports.BooleanField = exports.NumberField = exports.TimestampField = exports.DateField = exports.AtomicField = exports.Explore = exports.JoinRelationship = exports.TimestampTimeframe = exports.DateTimeframe = exports.AtomicFieldType = exports.SourceRelationship = void 0;
|
|
8
|
+
exports.pseudoModelFor = pseudoModelFor;
|
|
8
9
|
const model_1 = require("../../model");
|
|
9
10
|
const utils_1 = require("../../model/utils");
|
|
10
11
|
const dialect_1 = require("../../dialect");
|
|
@@ -22,6 +23,30 @@ function isSourceComponent(source) {
|
|
|
22
23
|
source.type === 'sql_select' ||
|
|
23
24
|
source.type === 'query_source');
|
|
24
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* A synthetic single-source model for an `Explore` that has no real model in
|
|
28
|
+
* hand — the deserialization (`Explore.fromJSON`) and raw-SQL-block paths.
|
|
29
|
+
* Wraps just the one struct so SQL generation has something to compile
|
|
30
|
+
* against.
|
|
31
|
+
*
|
|
32
|
+
* `modelID` + `modelAnnotations` reconstitute the model-annotation closure:
|
|
33
|
+
* `fromJSON` passes the values captured by `toJSON` so a deserialized Explore
|
|
34
|
+
* folds its model annotations exactly as the live one did. The raw-SQL-block
|
|
35
|
+
* and default paths pass nothing and get an empty map (the honest answer for a
|
|
36
|
+
* genuinely detached struct). The default constant `modelID` (rather than
|
|
37
|
+
* `mkModelDef`'s random one) keeps `fromJSON(x.toJSON())` deep-equal to `x` for
|
|
38
|
+
* the no-annotations case.
|
|
39
|
+
*/
|
|
40
|
+
const GENERATED_MODEL_ID = 'internal://generated-model';
|
|
41
|
+
function pseudoModelFor(structDef, modelID = GENERATED_MODEL_ID, modelAnnotations = {}) {
|
|
42
|
+
if (!(0, model_1.isSourceDef)(structDef)) {
|
|
43
|
+
throw new Error(`Cannot create pseudo model for struct type ${structDef.type}`);
|
|
44
|
+
}
|
|
45
|
+
const def = (0, utils_1.mkModelDef)('generated_model', modelID);
|
|
46
|
+
def.modelAnnotations = modelAnnotations;
|
|
47
|
+
def.contents[structDef.name] = structDef;
|
|
48
|
+
return def;
|
|
49
|
+
}
|
|
25
50
|
// =============================================================================
|
|
26
51
|
// Entity - Base class for Explore and Field types
|
|
27
52
|
// =============================================================================
|
|
@@ -130,12 +155,20 @@ var JoinRelationship;
|
|
|
130
155
|
// Explore
|
|
131
156
|
// =============================================================================
|
|
132
157
|
class Explore extends Entity {
|
|
133
|
-
constructor(structDef, parentExplore, source) {
|
|
158
|
+
constructor(modelDef, structDef, parentExplore, source) {
|
|
134
159
|
super((0, model_1.activeName)(structDef), parentExplore, source);
|
|
160
|
+
this._ownerModelDef = modelDef;
|
|
135
161
|
this._structDef = structDef;
|
|
136
162
|
this._parentExplore = parentExplore;
|
|
137
163
|
this.sourceExplore = source;
|
|
138
164
|
}
|
|
165
|
+
/** The model this Explore was resolved in. For detached Explores
|
|
166
|
+
* (`fromJSON`, raw SQL block) this is a synthetic single-source model
|
|
167
|
+
* with no model annotations. Read by child fields to resolve their own
|
|
168
|
+
* model annotations. */
|
|
169
|
+
get _modelDef() {
|
|
170
|
+
return this._ownerModelDef;
|
|
171
|
+
}
|
|
139
172
|
get source() {
|
|
140
173
|
return this.sourceExplore;
|
|
141
174
|
}
|
|
@@ -159,8 +192,15 @@ class Explore extends Entity {
|
|
|
159
192
|
get annotations() {
|
|
160
193
|
return new annotation_1.Annotations(this._structDef.annotations);
|
|
161
194
|
}
|
|
195
|
+
/** The model annotations resolved for this object. */
|
|
196
|
+
get modelAnnotations() {
|
|
197
|
+
return new annotation_1.Annotations((0, model_1.getModelAnnotations)(this._ownerModelDef));
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* @deprecated Use `.modelAnnotations.parseAsTag(route)`.
|
|
201
|
+
*/
|
|
162
202
|
get modelTag() {
|
|
163
|
-
this.parsedModelTag || (this.parsedModelTag =
|
|
203
|
+
this.parsedModelTag || (this.parsedModelTag = this.modelAnnotations.parseAsTag().tag);
|
|
164
204
|
return this.parsedModelTag;
|
|
165
205
|
}
|
|
166
206
|
/**
|
|
@@ -188,16 +228,8 @@ class Explore extends Entity {
|
|
|
188
228
|
};
|
|
189
229
|
return new PreparedQuery(internalQuery, this.getSingleExploreModel(), [], name);
|
|
190
230
|
}
|
|
191
|
-
get modelDef() {
|
|
192
|
-
if (!(0, model_1.isSourceDef)(this.structDef)) {
|
|
193
|
-
throw new Error(`Cannot create pseudo model for struct type ${this.structDef.type}`);
|
|
194
|
-
}
|
|
195
|
-
const def = (0, utils_1.mkModelDef)('generated_model');
|
|
196
|
-
def.contents[this.structDef.name] = this.structDef;
|
|
197
|
-
return def;
|
|
198
|
-
}
|
|
199
231
|
getSingleExploreModel() {
|
|
200
|
-
return new Model(this.
|
|
232
|
+
return new Model(this._ownerModelDef, [], []);
|
|
201
233
|
}
|
|
202
234
|
get fieldMap() {
|
|
203
235
|
var _a;
|
|
@@ -336,6 +368,8 @@ class Explore extends Entity {
|
|
|
336
368
|
var _a, _b;
|
|
337
369
|
return {
|
|
338
370
|
_structDef: this._structDef,
|
|
371
|
+
modelID: this._ownerModelDef.modelID,
|
|
372
|
+
modelAnnotations: this._ownerModelDef.modelAnnotations,
|
|
339
373
|
sourceExplore: (_a = this.sourceExplore) === null || _a === void 0 ? void 0 : _a.toJSON(),
|
|
340
374
|
_parentExplore: (_b = this._parentExplore) === null || _b === void 0 ? void 0 : _b.toJSON(),
|
|
341
375
|
};
|
|
@@ -347,7 +381,7 @@ class Explore extends Entity {
|
|
|
347
381
|
const sourceExplore = main_explore.sourceExplore !== undefined
|
|
348
382
|
? Explore.fromJSON(main_explore.sourceExplore)
|
|
349
383
|
: undefined;
|
|
350
|
-
return new Explore(main_explore._structDef, parentExplore, sourceExplore);
|
|
384
|
+
return new Explore(pseudoModelFor(main_explore._structDef, main_explore.modelID, main_explore.modelAnnotations), main_explore._structDef, parentExplore, sourceExplore);
|
|
351
385
|
}
|
|
352
386
|
get location() {
|
|
353
387
|
return this.structDef.location;
|
|
@@ -475,6 +509,10 @@ class AtomicField extends Entity {
|
|
|
475
509
|
get annotations() {
|
|
476
510
|
return new annotation_1.Annotations(this.fieldTypeDef.annotations);
|
|
477
511
|
}
|
|
512
|
+
/** The model annotations resolved for this field, via its parent. */
|
|
513
|
+
get modelAnnotations() {
|
|
514
|
+
return new annotation_1.Annotations((0, model_1.getModelAnnotations)(this.parent._modelDef));
|
|
515
|
+
}
|
|
478
516
|
isIntrinsic() {
|
|
479
517
|
return (0, model_1.fieldIsIntrinsic)(this.fieldTypeDef);
|
|
480
518
|
}
|
|
@@ -674,6 +712,13 @@ class Query extends Entity {
|
|
|
674
712
|
get annotations() {
|
|
675
713
|
return new annotation_1.Annotations(this.turtleDef.annotations);
|
|
676
714
|
}
|
|
715
|
+
/** The model annotations resolved for this view, via its parent
|
|
716
|
+
* explore. A bare `Query` with no parent has none. */
|
|
717
|
+
get modelAnnotations() {
|
|
718
|
+
var _a;
|
|
719
|
+
const modelDef = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._modelDef;
|
|
720
|
+
return new annotation_1.Annotations(modelDef && (0, model_1.getModelAnnotations)(modelDef));
|
|
721
|
+
}
|
|
677
722
|
}
|
|
678
723
|
exports.Query = Query;
|
|
679
724
|
class QueryField extends Query {
|
|
@@ -710,7 +755,7 @@ exports.QueryField = QueryField;
|
|
|
710
755
|
// =============================================================================
|
|
711
756
|
class ExploreField extends Explore {
|
|
712
757
|
constructor(structDef, parentExplore, source) {
|
|
713
|
-
super(structDef, parentExplore, source);
|
|
758
|
+
super(parentExplore._modelDef, structDef, parentExplore, source);
|
|
714
759
|
this._parentExplore = parentExplore;
|
|
715
760
|
}
|
|
716
761
|
get joinRelationship() {
|
|
@@ -874,21 +919,30 @@ class Model {
|
|
|
874
919
|
continue;
|
|
875
920
|
const decl = givens[entry.id];
|
|
876
921
|
if (decl && !decl.inline) {
|
|
877
|
-
out.set(surfaceName, new Given(surfaceName, entry.id, decl));
|
|
922
|
+
out.set(surfaceName, new Given(surfaceName, entry.id, decl, this.modelDef));
|
|
878
923
|
}
|
|
879
924
|
}
|
|
880
925
|
return out;
|
|
881
926
|
}
|
|
927
|
+
/** This model's own `##` bundle (its self-entry's `ownNotes`). */
|
|
928
|
+
get _ownModelAnnotations() {
|
|
929
|
+
var _a;
|
|
930
|
+
return (_a = this.modelDef.modelAnnotations[this.modelDef.modelID]) === null || _a === void 0 ? void 0 : _a.ownNotes;
|
|
931
|
+
}
|
|
882
932
|
/** @deprecated Use `.annotations.parseAsTag(route)`. */
|
|
883
933
|
tagParse(spec) {
|
|
884
|
-
return (0, annotation_1.annotationToTag)(this.
|
|
934
|
+
return (0, annotation_1.annotationToTag)(this._ownModelAnnotations, spec);
|
|
885
935
|
}
|
|
886
936
|
/** @deprecated Use `.annotations.texts(route)`. */
|
|
887
937
|
getTaglines(prefix) {
|
|
888
|
-
return (0, annotation_1.annotationToTaglines)(this.
|
|
938
|
+
return (0, annotation_1.annotationToTaglines)(this._ownModelAnnotations, prefix);
|
|
889
939
|
}
|
|
890
940
|
get annotations() {
|
|
891
|
-
return new annotation_1.Annotations(this.
|
|
941
|
+
return new annotation_1.Annotations(this._ownModelAnnotations);
|
|
942
|
+
}
|
|
943
|
+
/** The model annotations resolved across this model's import/extend lineage. */
|
|
944
|
+
get modelAnnotations() {
|
|
945
|
+
return new annotation_1.Annotations((0, model_1.getModelAnnotations)(this.modelDef));
|
|
892
946
|
}
|
|
893
947
|
/**
|
|
894
948
|
* Retrieve a reference for the token at the given position within the
|
|
@@ -976,7 +1030,7 @@ class Model {
|
|
|
976
1030
|
getExploreByName(name) {
|
|
977
1031
|
const struct = this.getContent(name);
|
|
978
1032
|
if (struct && (0, model_1.isSourceDef)(struct)) {
|
|
979
|
-
return new Explore(struct);
|
|
1033
|
+
return new Explore(this.modelDef, struct);
|
|
980
1034
|
}
|
|
981
1035
|
throw new Error("'name' is not an explore");
|
|
982
1036
|
}
|
|
@@ -988,7 +1042,7 @@ class Model {
|
|
|
988
1042
|
get explores() {
|
|
989
1043
|
return Object.values(this.modelDef.contents)
|
|
990
1044
|
.filter(model_1.isSourceDef)
|
|
991
|
-
.map(structDef => new Explore(structDef));
|
|
1045
|
+
.map(structDef => new Explore(this.modelDef, structDef));
|
|
992
1046
|
}
|
|
993
1047
|
/**
|
|
994
1048
|
* Enumerate the model's top-level queries by identifier.
|
|
@@ -1040,8 +1094,10 @@ class Model {
|
|
|
1040
1094
|
* @return BuildPlan with graphs and sources map
|
|
1041
1095
|
*/
|
|
1042
1096
|
getBuildPlan() {
|
|
1043
|
-
// Require experimental.persistence compiler flag
|
|
1044
|
-
|
|
1097
|
+
// Require experimental.persistence compiler flag. Read the resolved model
|
|
1098
|
+
// annotations (`.modelAnnotations`, the import/extend fold) rather than this
|
|
1099
|
+
// model's own `##` so the flag carries across extend.
|
|
1100
|
+
const modelTag = this.modelAnnotations.parseAsTag('!').tag;
|
|
1045
1101
|
if (!modelTag.has('experimental', 'persistence')) {
|
|
1046
1102
|
throw new Error('Model must have ##! experimental.persistence to use getBuildPlan()');
|
|
1047
1103
|
}
|
|
@@ -1069,7 +1125,7 @@ class Model {
|
|
|
1069
1125
|
if (!(node.sourceID in sourcesMap)) {
|
|
1070
1126
|
const sourceDef = (0, source_def_utils_1.resolveSourceID)(this.modelDef, node.sourceID);
|
|
1071
1127
|
if (sourceDef) {
|
|
1072
|
-
sourcesMap[node.sourceID] = new PersistSource(new Explore(sourceDef), this);
|
|
1128
|
+
sourcesMap[node.sourceID] = new PersistSource(new Explore(this.modelDef, sourceDef), this);
|
|
1073
1129
|
}
|
|
1074
1130
|
}
|
|
1075
1131
|
collectSources(node.dependsOn);
|
|
@@ -1167,6 +1223,10 @@ class PersistSource {
|
|
|
1167
1223
|
get annotations() {
|
|
1168
1224
|
return this.explore.annotations;
|
|
1169
1225
|
}
|
|
1226
|
+
/** The model annotations resolved for this source. */
|
|
1227
|
+
get modelAnnotations() {
|
|
1228
|
+
return this.explore.modelAnnotations;
|
|
1229
|
+
}
|
|
1170
1230
|
/**
|
|
1171
1231
|
* The connection name for this source.
|
|
1172
1232
|
*/
|
|
@@ -1247,11 +1307,14 @@ class Given {
|
|
|
1247
1307
|
* value to `.run({givens: {[name]: ...}})`.
|
|
1248
1308
|
* @param id Global GivenID. Stable across imports and renames.
|
|
1249
1309
|
* @param _internal The internal Given declaration record.
|
|
1310
|
+
* @param _modelDef The model this given is declared in, for resolving
|
|
1311
|
+
* its model annotations.
|
|
1250
1312
|
*/
|
|
1251
|
-
constructor(name, id, _internal) {
|
|
1313
|
+
constructor(name, id, _internal, _modelDef) {
|
|
1252
1314
|
this.name = name;
|
|
1253
1315
|
this.id = id;
|
|
1254
1316
|
this._internal = _internal;
|
|
1317
|
+
this._modelDef = _modelDef;
|
|
1255
1318
|
}
|
|
1256
1319
|
get type() {
|
|
1257
1320
|
return this._internal.type;
|
|
@@ -1274,6 +1337,10 @@ class Given {
|
|
|
1274
1337
|
get annotations() {
|
|
1275
1338
|
return new annotation_1.Annotations(this._internal.annotations);
|
|
1276
1339
|
}
|
|
1340
|
+
/** The model annotations resolved for this given. */
|
|
1341
|
+
get modelAnnotations() {
|
|
1342
|
+
return new annotation_1.Annotations((0, model_1.getModelAnnotations)(this._modelDef));
|
|
1343
|
+
}
|
|
1277
1344
|
}
|
|
1278
1345
|
exports.Given = Given;
|
|
1279
1346
|
/**
|
|
@@ -1314,6 +1381,10 @@ class PreparedQuery extends PipelineBase {
|
|
|
1314
1381
|
get _modelDef() {
|
|
1315
1382
|
return this._model._modelDef;
|
|
1316
1383
|
}
|
|
1384
|
+
/** The model annotations resolved for this query's head. */
|
|
1385
|
+
get modelAnnotations() {
|
|
1386
|
+
return new annotation_1.Annotations((0, model_1.getModelAnnotations)(this._modelDef));
|
|
1387
|
+
}
|
|
1317
1388
|
/**
|
|
1318
1389
|
* Generate the SQL for this query.
|
|
1319
1390
|
*
|
|
@@ -1423,6 +1494,10 @@ class PreparedResult {
|
|
|
1423
1494
|
get annotations() {
|
|
1424
1495
|
return new annotation_1.Annotations(this.inner.annotations);
|
|
1425
1496
|
}
|
|
1497
|
+
/** The model annotations resolved for this query's run-head. */
|
|
1498
|
+
get modelAnnotations() {
|
|
1499
|
+
return new annotation_1.Annotations((0, model_1.getModelAnnotations)(this.modelDef));
|
|
1500
|
+
}
|
|
1426
1501
|
/**
|
|
1427
1502
|
* @deprecated Hands out raw IR (`AnnotationsDef`). Use `.annotations`
|
|
1428
1503
|
* (returns the {@link Annotations} view) for read access. Internal
|
|
@@ -1433,15 +1508,15 @@ class PreparedResult {
|
|
|
1433
1508
|
return this.inner.annotations;
|
|
1434
1509
|
}
|
|
1435
1510
|
/**
|
|
1436
|
-
* @deprecated Hands out raw IR (`AnnotationsDef`). Internal code that
|
|
1437
|
-
*
|
|
1511
|
+
* @deprecated Hands out raw IR (`AnnotationsDef`). Internal code that needs
|
|
1512
|
+
* the model-level IR shape should call `getModelAnnotations(this.modelDef)`
|
|
1438
1513
|
* directly. Slated for removal once external consumers migrate.
|
|
1439
1514
|
*/
|
|
1440
1515
|
get modelAnnotation() {
|
|
1441
|
-
return this.modelDef
|
|
1516
|
+
return (0, model_1.getModelAnnotations)(this.modelDef);
|
|
1442
1517
|
}
|
|
1443
1518
|
get modelTag() {
|
|
1444
|
-
return new annotation_1.Annotations(this.modelDef
|
|
1519
|
+
return new annotation_1.Annotations((0, model_1.getModelAnnotations)(this.modelDef)).parseAsTag().tag;
|
|
1445
1520
|
}
|
|
1446
1521
|
/**
|
|
1447
1522
|
* @return The name of the connection this query should be run against.
|
|
@@ -1476,17 +1551,17 @@ class PreparedResult {
|
|
|
1476
1551
|
name: this.inner.queryName || explore.name,
|
|
1477
1552
|
};
|
|
1478
1553
|
try {
|
|
1479
|
-
return new Explore(namedExplore, this.sourceExplore);
|
|
1554
|
+
return new Explore(this.modelDef, namedExplore, this.sourceExplore);
|
|
1480
1555
|
}
|
|
1481
1556
|
catch (error) {
|
|
1482
|
-
return new Explore(namedExplore);
|
|
1557
|
+
return new Explore(this.modelDef, namedExplore);
|
|
1483
1558
|
}
|
|
1484
1559
|
}
|
|
1485
1560
|
get sourceExplore() {
|
|
1486
1561
|
const name = this.inner.sourceExplore;
|
|
1487
1562
|
const explore = (0, model_1.safeRecordGet)(this.modelDef.contents, name);
|
|
1488
1563
|
if (explore && (0, model_1.isSourceDef)(explore)) {
|
|
1489
|
-
return new Explore(explore);
|
|
1564
|
+
return new Explore(this.modelDef, explore);
|
|
1490
1565
|
}
|
|
1491
1566
|
}
|
|
1492
1567
|
get _sourceExploreName() {
|
|
@@ -1543,7 +1618,7 @@ class PreparedResult {
|
|
|
1543
1618
|
.set(['query_name'], this.inner.queryName || struct.name)
|
|
1544
1619
|
.toString(),
|
|
1545
1620
|
});
|
|
1546
|
-
const modelAnnotations = (0, to_stable_1.toStableAnnotations)(this.modelDef
|
|
1621
|
+
const modelAnnotations = (0, to_stable_1.toStableAnnotations)((0, model_1.getModelAnnotations)(this.modelDef));
|
|
1547
1622
|
return {
|
|
1548
1623
|
schema,
|
|
1549
1624
|
data,
|
|
@@ -666,6 +666,7 @@ class ModelMaterializer extends FluentState {
|
|
|
666
666
|
const queryModel = await compile_1.Malloy.compile({
|
|
667
667
|
source: text,
|
|
668
668
|
restrictedMode: true,
|
|
669
|
+
method: 'query',
|
|
669
670
|
urlReader,
|
|
670
671
|
connections,
|
|
671
672
|
model,
|
|
@@ -701,6 +702,7 @@ class ModelMaterializer extends FluentState {
|
|
|
701
702
|
urlReader,
|
|
702
703
|
connections,
|
|
703
704
|
model,
|
|
705
|
+
method: 'extendModel',
|
|
704
706
|
refreshSchemaCache: options === null || options === void 0 ? void 0 : options.refreshSchemaCache,
|
|
705
707
|
noThrowOnError: options === null || options === void 0 ? void 0 : options.noThrowOnError,
|
|
706
708
|
importBaseURL: options === null || options === void 0 ? void 0 : options.importBaseURL,
|
|
@@ -868,16 +870,6 @@ class ModelMaterializer extends FluentState {
|
|
|
868
870
|
}
|
|
869
871
|
}
|
|
870
872
|
exports.ModelMaterializer = ModelMaterializer;
|
|
871
|
-
// =============================================================================
|
|
872
|
-
// QueryMaterializer
|
|
873
|
-
// =============================================================================
|
|
874
|
-
function runSQLOptionsWithAnnotations(preparedResult, givenOptions) {
|
|
875
|
-
return {
|
|
876
|
-
queryAnnotations: preparedResult._rawQuery.annotations,
|
|
877
|
-
modelAnnotations: preparedResult._modelDef.annotations,
|
|
878
|
-
...givenOptions,
|
|
879
|
-
};
|
|
880
|
-
}
|
|
881
873
|
class QueryMaterializer extends FluentState {
|
|
882
874
|
constructor(runtime, materialize, options) {
|
|
883
875
|
super(runtime, materialize);
|
|
@@ -958,17 +950,15 @@ class QueryMaterializer extends FluentState {
|
|
|
958
950
|
async run(options) {
|
|
959
951
|
const connections = this.runtime.connections;
|
|
960
952
|
const preparedResult = await this.getPreparedResult(options);
|
|
961
|
-
|
|
962
|
-
return compile_1.Malloy.run({ connections, preparedResult, options: finalOptions });
|
|
953
|
+
return compile_1.Malloy.run({ connections, preparedResult, options });
|
|
963
954
|
}
|
|
964
955
|
async *runStream(options) {
|
|
965
956
|
const preparedResult = await this.getPreparedResult(options);
|
|
966
957
|
const connections = this.runtime.connections;
|
|
967
|
-
const finalOptions = runSQLOptionsWithAnnotations(preparedResult, options);
|
|
968
958
|
const stream = compile_1.Malloy.runStream({
|
|
969
959
|
connections,
|
|
970
960
|
preparedResult,
|
|
971
|
-
options
|
|
961
|
+
options,
|
|
972
962
|
});
|
|
973
963
|
for await (const row of stream) {
|
|
974
964
|
yield row;
|
|
@@ -1010,7 +1000,9 @@ class QueryMaterializer extends FluentState {
|
|
|
1010
1000
|
buildManifest = undefined;
|
|
1011
1001
|
}
|
|
1012
1002
|
if (buildManifest) {
|
|
1013
|
-
|
|
1003
|
+
// Resolved model annotations (the import/extend fold), so the
|
|
1004
|
+
// `experimental.persistence` flag carries across extend.
|
|
1005
|
+
const modelTag = preparedQuery.model.modelAnnotations.parseAsTag('!').tag;
|
|
1014
1006
|
if (!modelTag.has('experimental', 'persistence')) {
|
|
1015
1007
|
if (explicitManifest) {
|
|
1016
1008
|
// Explicitly passed non-empty manifest requires persistence support
|
|
@@ -1177,21 +1169,19 @@ class PreparedResultMaterializer extends FluentState {
|
|
|
1177
1169
|
async run(options) {
|
|
1178
1170
|
const preparedResult = await this.getPreparedResult();
|
|
1179
1171
|
const connections = this.runtime.connections;
|
|
1180
|
-
const finalOptions = runSQLOptionsWithAnnotations(preparedResult, options);
|
|
1181
1172
|
return compile_1.Malloy.run({
|
|
1182
1173
|
connections,
|
|
1183
1174
|
preparedResult,
|
|
1184
|
-
options
|
|
1175
|
+
options,
|
|
1185
1176
|
});
|
|
1186
1177
|
}
|
|
1187
1178
|
async *runStream(options) {
|
|
1188
1179
|
const preparedResult = await this.getPreparedResult();
|
|
1189
1180
|
const connections = this.runtime.connections;
|
|
1190
|
-
const finalOptions = runSQLOptionsWithAnnotations(preparedResult, options);
|
|
1191
1181
|
const stream = compile_1.Malloy.runStream({
|
|
1192
1182
|
connections,
|
|
1193
1183
|
preparedResult,
|
|
1194
|
-
options
|
|
1184
|
+
options,
|
|
1195
1185
|
});
|
|
1196
1186
|
for await (const row of stream) {
|
|
1197
1187
|
yield row;
|
|
@@ -11,6 +11,11 @@ export interface Taggable {
|
|
|
11
11
|
* `tagParse`/`getTaglines`, this sees multi-line annotations (`#|`…`|#`).
|
|
12
12
|
*/
|
|
13
13
|
readonly annotations: Annotations;
|
|
14
|
+
/**
|
|
15
|
+
* The model annotations for this object, resolved across its import/extend
|
|
16
|
+
* lineage. Empty for an object with no model in hand.
|
|
17
|
+
*/
|
|
18
|
+
readonly modelAnnotations: Annotations;
|
|
14
19
|
/**
|
|
15
20
|
* @deprecated The RegExp form cannot see multi-line annotations
|
|
16
21
|
* (`#|`…`|#`) and cannot report content offsets for error mapping. Use
|
|
@@ -21,7 +21,22 @@ export interface ParseOptions {
|
|
|
21
21
|
testEnvironment?: boolean;
|
|
22
22
|
/** Reject language constructs that reach outside the trusted model. */
|
|
23
23
|
restrictedMode?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Diagnostic label for the synthetic URL minted when compiling inline
|
|
26
|
+
* source that has no URL of its own: `internal://<method>/<uuid>`. Each
|
|
27
|
+
* such compile still gets a unique id regardless; this just makes the
|
|
28
|
+
* originating operation legible in error locations and annotation
|
|
29
|
+
* provenance. Read solely to build that URL — never branched on.
|
|
30
|
+
*/
|
|
31
|
+
method?: CompileMethod;
|
|
24
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* The operation behind a URL-less (inline-source) compile, used only to
|
|
35
|
+
* label its synthetic `internal://` URL. `query` covers both the stable
|
|
36
|
+
* query-compile path and `loadRestrictedQuery`; `loadQuery` is a `loadModel`
|
|
37
|
+
* under the hood and carries that label.
|
|
38
|
+
*/
|
|
39
|
+
export type CompileMethod = 'loadModel' | 'extendModel' | 'query';
|
|
25
40
|
/** Options for how to run the Malloy semantic checker/translator */
|
|
26
41
|
export interface CompileOptions {
|
|
27
42
|
refreshSchemaCache?: boolean | number;
|
package/dist/api/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Contributors to the Malloy project
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
2
6
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
7
|
if (k2 === undefined) k2 = k;
|
|
4
8
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -37,12 +41,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
37
41
|
};
|
|
38
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
43
|
exports.util = exports.asynchronous = exports.stateless = exports.sessioned = void 0;
|
|
40
|
-
/*
|
|
41
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
42
|
-
*
|
|
43
|
-
* This source code is licensed under the MIT license found in the
|
|
44
|
-
* LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/
|
|
46
44
|
exports.sessioned = __importStar(require("./sessioned"));
|
|
47
45
|
exports.stateless = __importStar(require("./stateless"));
|
|
48
46
|
exports.asynchronous = __importStar(require("./asynchronous"));
|
package/dist/api/sessioned.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/api/stateless.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/api/util.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.DEFAULT_LOG_RANGE = void 0;
|
|
@@ -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.BaseConnection = void 0;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import type { RunSQLOptions } from '../run_sql_options';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MalloyQueryData, QueryRecord, QueryRunStats, SQLSourceDef, TableSourceDef } from '../model/malloy_types';
|
|
3
3
|
import type { SQLSourceRequest } from '../lang/translate-response';
|
|
4
4
|
/**
|
|
5
5
|
* Options passed to fetchSchema methods.
|
|
6
6
|
*/
|
|
7
7
|
export interface FetchSchemaOptions {
|
|
8
8
|
refreshTimestamp?: number;
|
|
9
|
-
/** Model annotations forwarded to the adapter (e.g. `##!` dialect flags). */
|
|
10
|
-
modelAnnotations?: AnnotationsDef;
|
|
11
9
|
}
|
|
12
10
|
/**
|
|
13
11
|
* An object capable of reading schemas for given table names.
|
package/dist/connection_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.toAsyncGenerator = toAsyncGenerator;
|
package/dist/dialect/dialect.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.Dialect = exports.dayIndex = exports.EscapeStyle = exports.MAX_DECIMAL38 = exports.MIN_DECIMAL38 = exports.MAX_INT128 = exports.MIN_INT128 = exports.MAX_INT64 = exports.MIN_INT64 = exports.MAX_INT32 = exports.MIN_INT32 = void 0;
|
|
@@ -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.getDialect = getDialect;
|
|
@@ -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.DUCKDB_DIALECT_FUNCTIONS = void 0;
|