@malloydata/malloy 0.0.121-dev240201150428 → 0.0.121-dev240202151212
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/dialect/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { DialectFunctionOverloadDef } from './functions/util';
|
|
2
|
-
export { arg, anyExprType, makeParam, overload, minScalar, minAggregate, maxScalar, spread, sqlFragment, param, sql, } from './functions/util';
|
|
2
|
+
export { arg, anyExprType, makeParam, overload, minScalar, minAggregate, maxScalar, spread, sqlFragment, param, params, literal, sql, } from './functions/util';
|
|
3
3
|
export { Dialect, qtz } from './dialect';
|
|
4
4
|
export type { DialectFieldList, QueryInfo } from './dialect';
|
|
5
5
|
export { StandardSQLDialect } from './standardsql';
|
package/dist/dialect/index.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.FUNCTIONS = exports.getDialectFunction = exports.registerDialect = exports.getDialect = exports.DuckDBDialect = exports.PostgresDialect = exports.StandardSQLDialect = exports.qtz = exports.Dialect = exports.sql = exports.param = exports.sqlFragment = exports.spread = exports.maxScalar = exports.minAggregate = exports.minScalar = exports.overload = exports.makeParam = exports.anyExprType = exports.arg = void 0;
|
|
25
|
+
exports.FUNCTIONS = exports.getDialectFunction = exports.registerDialect = exports.getDialect = exports.DuckDBDialect = exports.PostgresDialect = exports.StandardSQLDialect = exports.qtz = exports.Dialect = exports.sql = exports.literal = exports.params = exports.param = exports.sqlFragment = exports.spread = exports.maxScalar = exports.minAggregate = exports.minScalar = exports.overload = exports.makeParam = exports.anyExprType = exports.arg = void 0;
|
|
26
26
|
var util_1 = require("./functions/util");
|
|
27
27
|
Object.defineProperty(exports, "arg", { enumerable: true, get: function () { return util_1.arg; } });
|
|
28
28
|
Object.defineProperty(exports, "anyExprType", { enumerable: true, get: function () { return util_1.anyExprType; } });
|
|
@@ -34,6 +34,8 @@ Object.defineProperty(exports, "maxScalar", { enumerable: true, get: function ()
|
|
|
34
34
|
Object.defineProperty(exports, "spread", { enumerable: true, get: function () { return util_1.spread; } });
|
|
35
35
|
Object.defineProperty(exports, "sqlFragment", { enumerable: true, get: function () { return util_1.sqlFragment; } });
|
|
36
36
|
Object.defineProperty(exports, "param", { enumerable: true, get: function () { return util_1.param; } });
|
|
37
|
+
Object.defineProperty(exports, "params", { enumerable: true, get: function () { return util_1.params; } });
|
|
38
|
+
Object.defineProperty(exports, "literal", { enumerable: true, get: function () { return util_1.literal; } });
|
|
37
39
|
Object.defineProperty(exports, "sql", { enumerable: true, get: function () { return util_1.sql; } });
|
|
38
40
|
var dialect_1 = require("./dialect");
|
|
39
41
|
Object.defineProperty(exports, "Dialect", { enumerable: true, get: function () { return dialect_1.Dialect; } });
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DuckDBDialect, StandardSQLDialect, PostgresDialect, registerDialect, arg, qtz, overload, minScalar, anyExprType, minAggregate, maxScalar, sql, makeParam, sqlFragment, param, spread, Dialect, FUNCTIONS, } from './dialect';
|
|
1
|
+
export { DuckDBDialect, StandardSQLDialect, PostgresDialect, registerDialect, arg, qtz, overload, minScalar, anyExprType, minAggregate, maxScalar, sql, makeParam, sqlFragment, param, params, literal, spread, Dialect, FUNCTIONS, } from './dialect';
|
|
2
2
|
export type { DialectFieldList, DialectFunctionOverloadDef, QueryInfo, } from './dialect';
|
|
3
3
|
export type { QueryDataRow, Fragment, StructDef, StructRelationship, NamedStructDefs, MalloyQueryData, AtomicFieldType as AtomicFieldTypeInner, DateUnit, ExtractUnit, TimestampUnit, TimeFieldType, QueryData, QueryValue, FieldTypeDef, Expr, DialectFragment, TimeValue, FilterExpression, SQLBlock, FieldAtomicDef, FieldDef, PipeSegment, QueryFieldDef, IndexFieldDef, TurtleDef, SearchValueMapResult, SearchIndexResult, ModelDef, Query, QueryResult, QueryRunStats, NamedQuery, NamedModelObject, ExpressionType, FunctionDef, FunctionOverloadDef, FunctionParameterDef, ExpressionValueType, TypeDesc, FieldValueType, ExpressionTypeDesc, FunctionParamTypeDesc, DocumentLocation, DocumentRange, DocumentPosition, Sampling, TypecastFragment, Annotation, FieldAtomicTypeDef, SQLBlockStructDef, } from './model';
|
|
4
4
|
export { Segment, isSamplingEnable, isSamplingPercent, isSamplingRows, mkExpr, expressionIsCalculation, indent, } from './model';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Explore = exports.DataWriter = exports.Parse = exports.JSONWriter = exports.CSVWriter = exports.QueryMaterializer = exports.Result = exports.PreparedResult = exports.TimestampTimeframe = exports.DateTimeframe = exports.SourceRelationship = exports.JoinRelationship = exports.MalloyError = exports.FixedConnectionMap = exports.InMemoryURLReader = exports.EmptyURLReader = exports.SingleConnectionRuntime = exports.ConnectionRuntime = exports.AtomicFieldType = exports.Runtime = exports.Malloy = exports.MalloyTranslator = exports.HighlightType = exports.indent = exports.expressionIsCalculation = exports.mkExpr = exports.isSamplingRows = exports.isSamplingPercent = exports.isSamplingEnable = exports.Segment = exports.FUNCTIONS = exports.Dialect = exports.spread = exports.literal = exports.params = exports.param = exports.sqlFragment = exports.makeParam = exports.sql = exports.maxScalar = exports.minAggregate = exports.anyExprType = exports.minScalar = exports.overload = exports.qtz = exports.arg = exports.registerDialect = exports.PostgresDialect = exports.StandardSQLDialect = exports.DuckDBDialect = void 0;
|
|
4
|
+
exports.Tag = exports.toAsyncGenerator = void 0;
|
|
4
5
|
/*
|
|
5
6
|
* Copyright 2023 Google LLC
|
|
6
7
|
*
|
|
@@ -39,6 +40,8 @@ Object.defineProperty(exports, "sql", { enumerable: true, get: function () { ret
|
|
|
39
40
|
Object.defineProperty(exports, "makeParam", { enumerable: true, get: function () { return dialect_1.makeParam; } });
|
|
40
41
|
Object.defineProperty(exports, "sqlFragment", { enumerable: true, get: function () { return dialect_1.sqlFragment; } });
|
|
41
42
|
Object.defineProperty(exports, "param", { enumerable: true, get: function () { return dialect_1.param; } });
|
|
43
|
+
Object.defineProperty(exports, "params", { enumerable: true, get: function () { return dialect_1.params; } });
|
|
44
|
+
Object.defineProperty(exports, "literal", { enumerable: true, get: function () { return dialect_1.literal; } });
|
|
42
45
|
Object.defineProperty(exports, "spread", { enumerable: true, get: function () { return dialect_1.spread; } });
|
|
43
46
|
Object.defineProperty(exports, "Dialect", { enumerable: true, get: function () { return dialect_1.Dialect; } });
|
|
44
47
|
Object.defineProperty(exports, "FUNCTIONS", { enumerable: true, get: function () { return dialect_1.FUNCTIONS; } });
|
|
@@ -120,8 +120,9 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
120
120
|
}
|
|
121
121
|
inExperiment(experimentID, cx) {
|
|
122
122
|
const experimental = this.compilerFlags.tag('experimental');
|
|
123
|
-
if (experimental
|
|
124
|
-
|
|
123
|
+
if (experimental &&
|
|
124
|
+
(experimental.bare() || experimental.has(experimentID))) {
|
|
125
|
+
return true;
|
|
125
126
|
}
|
|
126
127
|
this.contextError(cx, `Experimental flag '${experimentID}' required to enable this feature`);
|
|
127
128
|
return false;
|
|
@@ -173,6 +173,17 @@ describe('expressions', () => {
|
|
|
173
173
|
}
|
|
174
174
|
`).translationToFailWith("Experimental flag 'function_order_by' required to enable this feature", "Experimental flag 'partition_by' required to enable this feature", "Experimental flag 'aggregate_limit' required to enable this feature");
|
|
175
175
|
});
|
|
176
|
+
test('props not allowed with different experiment enabled', () => {
|
|
177
|
+
expect((0, test_translator_1.markSource) `
|
|
178
|
+
##! experimental.something_else
|
|
179
|
+
run: a -> {
|
|
180
|
+
group_by: ai
|
|
181
|
+
group_by: x1 is string_agg(astr) { order_by: ai }
|
|
182
|
+
group_by: x2 is lag(ai) { partition_by: ai }
|
|
183
|
+
group_by: x3 is string_agg(astr) { limit: 10 }
|
|
184
|
+
}
|
|
185
|
+
`).translationToFailWith("Experimental flag 'function_order_by' required to enable this feature", "Experimental flag 'partition_by' required to enable this feature", "Experimental flag 'aggregate_limit' required to enable this feature");
|
|
186
|
+
});
|
|
176
187
|
test('props not allowed on most expressions', () => {
|
|
177
188
|
expect((0, test_translator_1.markSource) `
|
|
178
189
|
##! experimental { function_order_by partition_by aggregate_limit }
|
|
@@ -71,6 +71,9 @@ describe('model statements', () => {
|
|
|
71
71
|
test('experimental explicit enable', () => {
|
|
72
72
|
expect('##! experimental { compilerTestExperimentParse compilerTestExperimentTranslate }\n;;[ "x" ]').toTranslate();
|
|
73
73
|
});
|
|
74
|
+
test('experiments do not bleed into one another', () => {
|
|
75
|
+
expect('##! experimental { this_experiment_does_not_exist }\n;;[ "x" ]').translationToFailWith("Experimental flag 'compilerTestExperimentParse' required to enable this feature");
|
|
76
|
+
});
|
|
74
77
|
test('experiment failures in parse are flagged', () => {
|
|
75
78
|
expect(';;[ "x" ]').translationToFailWith("Experimental flag 'compilerTestExperimentParse' required to enable this feature");
|
|
76
79
|
});
|