@malloydata/malloy 0.0.22-dev230126015148 → 0.0.22-dev230206094309

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.
Files changed (93) hide show
  1. package/package.json +2 -2
  2. package/dist/connection_utils.d.ts +0 -1
  3. package/dist/connection_utils.js +0 -66
  4. package/dist/dialect/dialect.d.ts +0 -66
  5. package/dist/dialect/dialect.js +0 -85
  6. package/dist/dialect/dialect_map.d.ts +0 -3
  7. package/dist/dialect/dialect_map.js +0 -45
  8. package/dist/dialect/duckdb.d.ts +0 -52
  9. package/dist/dialect/duckdb.js +0 -364
  10. package/dist/dialect/index.d.ts +0 -6
  11. package/dist/dialect/index.js +0 -37
  12. package/dist/dialect/postgres.d.ts +0 -52
  13. package/dist/dialect/postgres.js +0 -330
  14. package/dist/dialect/standardsql.d.ts +0 -49
  15. package/dist/dialect/standardsql.js +0 -381
  16. package/dist/index.d.ts +0 -10
  17. package/dist/index.js +0 -59
  18. package/dist/lang/ast/apply-expr.d.ts +0 -3
  19. package/dist/lang/ast/apply-expr.js +0 -34
  20. package/dist/lang/ast/ast-expr.d.ts +0 -206
  21. package/dist/lang/ast/ast-expr.js +0 -781
  22. package/dist/lang/ast/ast-main.d.ts +0 -915
  23. package/dist/lang/ast/ast-main.js +0 -3672
  24. package/dist/lang/ast/ast-time-expr.d.ts +0 -69
  25. package/dist/lang/ast/ast-time-expr.js +0 -389
  26. package/dist/lang/ast/ast-types.d.ts +0 -83
  27. package/dist/lang/ast/ast-types.js +0 -225
  28. package/dist/lang/ast/index.d.ts +0 -5
  29. package/dist/lang/ast/index.js +0 -44
  30. package/dist/lang/ast/time-utils.d.ts +0 -9
  31. package/dist/lang/ast/time-utils.js +0 -104
  32. package/dist/lang/field-utils.d.ts +0 -5
  33. package/dist/lang/field-utils.js +0 -43
  34. package/dist/lang/index.d.ts +0 -9
  35. package/dist/lang/index.js +0 -32
  36. package/dist/lang/lib/Malloy/MalloyLexer.d.ts +0 -165
  37. package/dist/lang/lib/Malloy/MalloyLexer.js +0 -1232
  38. package/dist/lang/lib/Malloy/MalloyParser.d.ts +0 -1947
  39. package/dist/lang/lib/Malloy/MalloyParser.js +0 -11909
  40. package/dist/lang/lib/Malloy/MalloyParserListener.d.ts +0 -2022
  41. package/dist/lang/lib/Malloy/MalloyParserListener.js +0 -4
  42. package/dist/lang/lib/Malloy/MalloyParserVisitor.d.ts +0 -1274
  43. package/dist/lang/lib/Malloy/MalloyParserVisitor.js +0 -4
  44. package/dist/lang/parse-log.d.ts +0 -27
  45. package/dist/lang/parse-log.js +0 -51
  46. package/dist/lang/parse-malloy.d.ts +0 -236
  47. package/dist/lang/parse-malloy.js +0 -746
  48. package/dist/lang/parse-to-ast.d.ts +0 -155
  49. package/dist/lang/parse-to-ast.js +0 -990
  50. package/dist/lang/parse-tree-walkers/document-completion-walker.d.ts +0 -10
  51. package/dist/lang/parse-tree-walkers/document-completion-walker.js +0 -148
  52. package/dist/lang/parse-tree-walkers/document-help-context-walker.d.ts +0 -9
  53. package/dist/lang/parse-tree-walkers/document-help-context-walker.js +0 -107
  54. package/dist/lang/parse-tree-walkers/document-highlight-walker.d.ts +0 -83
  55. package/dist/lang/parse-tree-walkers/document-highlight-walker.js +0 -385
  56. package/dist/lang/parse-tree-walkers/document-symbol-walker.d.ts +0 -11
  57. package/dist/lang/parse-tree-walkers/document-symbol-walker.js +0 -182
  58. package/dist/lang/parse-tree-walkers/explore-query-walker.d.ts +0 -34
  59. package/dist/lang/parse-tree-walkers/explore-query-walker.js +0 -74
  60. package/dist/lang/parse-tree-walkers/find-external-references.d.ts +0 -11
  61. package/dist/lang/parse-tree-walkers/find-external-references.js +0 -61
  62. package/dist/lang/reference-list.d.ts +0 -10
  63. package/dist/lang/reference-list.js +0 -90
  64. package/dist/lang/space-field.d.ts +0 -17
  65. package/dist/lang/space-field.js +0 -127
  66. package/dist/lang/test/document-help-context-walker.spec.d.ts +0 -1
  67. package/dist/lang/test/document-help-context-walker.spec.js +0 -55
  68. package/dist/lang/test/document-symbol-walker.spec.d.ts +0 -1
  69. package/dist/lang/test/document-symbol-walker.spec.js +0 -110
  70. package/dist/lang/test/field-symbols.spec.d.ts +0 -1
  71. package/dist/lang/test/field-symbols.spec.js +0 -180
  72. package/dist/lang/test/parse.spec.d.ts +0 -14
  73. package/dist/lang/test/parse.spec.js +0 -2134
  74. package/dist/lang/test/test-translator.d.ts +0 -38
  75. package/dist/lang/test/test-translator.js +0 -344
  76. package/dist/lang/zone.d.ts +0 -57
  77. package/dist/lang/zone.js +0 -107
  78. package/dist/malloy.d.ts +0 -1146
  79. package/dist/malloy.js +0 -2413
  80. package/dist/model/index.d.ts +0 -2
  81. package/dist/model/index.js +0 -45
  82. package/dist/model/malloy_query.d.ts +0 -351
  83. package/dist/model/malloy_query.js +0 -3174
  84. package/dist/model/malloy_types.d.ts +0 -551
  85. package/dist/model/malloy_types.js +0 -378
  86. package/dist/model/sql_block.d.ts +0 -7
  87. package/dist/model/sql_block.js +0 -56
  88. package/dist/model/utils.d.ts +0 -22
  89. package/dist/model/utils.js +0 -102
  90. package/dist/run_sql_options.d.ts +0 -3
  91. package/dist/run_sql_options.js +0 -25
  92. package/dist/runtime_types.d.ts +0 -105
  93. package/dist/runtime_types.js +0 -25
@@ -1,381 +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.StandardSQLDialect = void 0;
26
- const utils_1 = require("../model/utils");
27
- const malloy_types_1 = require("../model/malloy_types");
28
- const dialect_1 = require("./dialect");
29
- const castMap = {
30
- number: "float64",
31
- };
32
- // These are the units that "TIMESTAMP_ADD" accepts
33
- const timestampAddUnits = [
34
- "microsecond",
35
- "millisecond",
36
- "second",
37
- "minute",
38
- "hour",
39
- "day",
40
- ];
41
- const extractMap = {
42
- day_of_week: "dayofweek",
43
- day_of_year: "dayofyear",
44
- };
45
- class StandardSQLDialect extends dialect_1.Dialect {
46
- constructor() {
47
- super(...arguments);
48
- this.name = "standardsql";
49
- this.defaultNumberType = "FLOAT64";
50
- this.udfPrefix = "__udf";
51
- this.hasFinalStage = false;
52
- this.stringTypeName = "STRING";
53
- this.divisionIsInteger = false;
54
- this.supportsSumDistinctFunction = false;
55
- this.unnestWithNumbers = false;
56
- this.defaultSampling = { enable: false };
57
- this.supportUnnestArrayAgg = false;
58
- this.supportsCTEinCoorelatedSubQueries = false;
59
- this.dontUnionIndex = true; // bigquery can't use a sample table more than once in a query.
60
- this.supportsQualify = true;
61
- // I think we want an optional list of parameters types that we force a cast to.
62
- this.functionInfo = {
63
- timestamp_seconds: {
64
- returnType: "timestamp",
65
- },
66
- concat: { returnType: "string" },
67
- };
68
- this.keywords = `
69
- ALL
70
- AND
71
- ANY
72
- ARRAY
73
- AS
74
- ASC
75
- ASSERT_ROWS_MODIFIED
76
- AT
77
- BETWEEN
78
- BY
79
- CASE
80
- CAST
81
- COLLATE
82
- CONTAINS
83
- CREATE
84
- CROSS
85
- CUBE
86
- CURRENT
87
- DEFAULT
88
- DEFINE
89
- DESC
90
- DISTINCT
91
- ELSE
92
- END
93
- ENUM
94
- ESCAPE
95
- EXCEPT
96
- EXCLUDE
97
- EXISTS
98
- EXTRACT
99
- FALSE
100
- FETCH
101
- FOLLOWING
102
- FOR
103
- FROM
104
- FULL
105
- GROUP
106
- GROUPING
107
- GROUPS
108
- HASH
109
- HAVING
110
- IF
111
- IGNORE
112
- IN
113
- INNER
114
- INTERSECT
115
- INTERVAL
116
- INTO
117
- IS
118
- JOIN
119
- LATERAL
120
- LEFT
121
- LIKE
122
- LIMIT
123
- LOOKUP
124
- MERGE
125
- NATURAL
126
- NEW
127
- NO
128
- NOT
129
- NULL
130
- NULLS
131
- OF
132
- ON
133
- OR
134
- ORDER
135
- OUTER
136
- OVER
137
- PARTITION
138
- PRECEDING
139
- PROTO
140
- RANGE
141
- RECURSIVE
142
- RESPECT
143
- RIGHT
144
- ROLLUP
145
- ROWS
146
- SELECT
147
- SET
148
- SOME
149
- STRUCT
150
- TABLESAMPLE
151
- THEN
152
- TO
153
- TREAT
154
- TRUE
155
- UNBOUNDED
156
- UNION
157
- UNNEST
158
- USING
159
- WHEN
160
- WHERE
161
- WINDOW
162
- WITH
163
- WITHIN`.split(/\s/);
164
- }
165
- quoteTablePath(tablePath) {
166
- return `\`${tablePath}\``;
167
- }
168
- sqlGroupSetTable(groupSetCount) {
169
- return `CROSS JOIN (SELECT row_number() OVER() -1 group_set FROM UNNEST(GENERATE_ARRAY(0,${groupSetCount},1)))`;
170
- }
171
- sqlAnyValue(groupSet, fieldName) {
172
- return `ANY_VALUE(CASE WHEN group_set=${groupSet} THEN ${fieldName} END)`;
173
- }
174
- // can array agg or any_value a struct...
175
- sqlAggregateTurtle(groupSet, fieldList, orderBy, limit) {
176
- let tail = "";
177
- if (limit !== undefined) {
178
- tail += ` LIMIT ${limit}`;
179
- }
180
- const fields = fieldList
181
- .map((f) => `\n ${f.sqlExpression} as ${f.sqlOutputName}`)
182
- .join(", ");
183
- return `ARRAY_AGG(CASE WHEN group_set=${groupSet} THEN STRUCT(${fields}\n ) END IGNORE NULLS ${orderBy} ${tail})`;
184
- }
185
- sqlAnyValueTurtle(groupSet, fieldList) {
186
- const fields = fieldList
187
- .map((f) => `${f.sqlExpression} as ${f.sqlOutputName}`)
188
- .join(", ");
189
- return `ANY_VALUE(CASE WHEN group_set=${groupSet} THEN STRUCT(${fields}))`;
190
- }
191
- sqlAnyValueLastTurtle(name, groupSet, sqlName) {
192
- return `ANY_VALUE(CASE WHEN group_set=${groupSet} THEN ${name}__${groupSet} END) as ${sqlName}`;
193
- }
194
- sqlCoaleseMeasuresInline(groupSet, fieldList) {
195
- const fields = fieldList
196
- .map((f) => `${f.sqlExpression} as ${f.sqlOutputName}`)
197
- .join(", ");
198
- const nullValues = fieldList
199
- .map((f) => `NULL as ${f.sqlOutputName}`)
200
- .join(", ");
201
- return `COALESCE(ANY_VALUE(CASE WHEN group_set=${groupSet} THEN STRUCT(${fields}) END), STRUCT(${nullValues}))`;
202
- }
203
- //
204
- // this code used to be:
205
- //
206
- // from += `JOIN UNNEST(GENERATE_ARRAY(0,${this.maxGroupSet},1)) as group_set\n`;
207
- //
208
- // BigQuery will allocate more resources if we use a CROSS JOIN so we do that instead.
209
- //
210
- sqlUnnestAlias(source, alias, fieldList, needDistinctKey, isArray) {
211
- if (isArray) {
212
- if (needDistinctKey) {
213
- return `LEFT JOIN UNNEST(ARRAY(( SELECT AS STRUCT row_number() over() as __row_id, value FROM UNNEST(${source}) value))) as ${alias}`;
214
- }
215
- else {
216
- return `LEFT JOIN UNNEST(ARRAY((SELECT AS STRUCT value FROM unnest(${source}) value))) as ${alias}`;
217
- }
218
- }
219
- else if (needDistinctKey) {
220
- return `LEFT JOIN UNNEST(ARRAY(( SELECT AS STRUCT row_number() over() as __row_id, * FROM UNNEST(${source})))) as ${alias}`;
221
- }
222
- else {
223
- return `LEFT JOIN UNNEST(${source}) as ${alias}`;
224
- }
225
- }
226
- sqlSumDistinctHashedKey(sqlDistinctKey) {
227
- sqlDistinctKey = `CAST(${sqlDistinctKey} AS STRING)`;
228
- const upperPart = `cast(cast(concat('0x', substr(to_hex(md5(${sqlDistinctKey})), 1, 15)) as int64) as numeric) * 4294967296`;
229
- const lowerPart = `cast(cast(concat('0x', substr(to_hex(md5(${sqlDistinctKey})), 16, 8)) as int64) as numeric)`;
230
- // See the comment below on `sql_sum_distinct` for why we multiply by this decimal
231
- const precisionShiftMultiplier = "0.000000001";
232
- return `(${upperPart} + ${lowerPart}) * ${precisionShiftMultiplier}`;
233
- }
234
- sqlGenerateUUID() {
235
- return `GENERATE_UUID()`;
236
- }
237
- sqlFieldReference(alias, fieldName, _fieldType, _isNested, _isArray) {
238
- return `${alias}.${fieldName}`;
239
- }
240
- sqlUnnestPipelineHead(isSingleton, sourceSQLExpression) {
241
- let p = sourceSQLExpression;
242
- if (isSingleton) {
243
- p = `[${p}]`;
244
- }
245
- return `UNNEST(${p})`;
246
- }
247
- sqlCreateFunction(id, funcText) {
248
- return `CREATE TEMPORARY FUNCTION ${id}(__param ANY TYPE) AS ((\n${(0, utils_1.indent)(funcText)}));\n`;
249
- }
250
- sqlCreateTableAsSelect(tableName, sql) {
251
- return `
252
- CREATE TABLE IF NOT EXISTS \`${tableName}\`
253
- OPTIONS (
254
- expiration_timestamp=TIMESTAMP_ADD(current_timestamp(), INTERVAL 1 hour)
255
- )
256
- AS (
257
- ${(0, utils_1.indent)(sql)}
258
- );
259
- `;
260
- }
261
- sqlCreateFunctionCombineLastStage(lastStageName) {
262
- return `SELECT ARRAY((SELECT AS STRUCT * FROM ${lastStageName}))\n`;
263
- }
264
- sqlSelectAliasAsStruct(alias) {
265
- return `(SELECT AS STRUCT ${alias}.*)`;
266
- }
267
- sqlMaybeQuoteIdentifier(identifier) {
268
- return this.keywords.indexOf(identifier.toUpperCase()) > 0
269
- ? "`" + identifier + "`"
270
- : identifier;
271
- }
272
- sqlNow() {
273
- return (0, malloy_types_1.mkExpr) `CURRENT_TIMESTAMP()`;
274
- }
275
- sqlTrunc(sqlTime, units) {
276
- if (sqlTime.valueType == "date") {
277
- if ((0, malloy_types_1.isDateUnit)(units)) {
278
- return (0, malloy_types_1.mkExpr) `DATE_TRUNC(${sqlTime.value},${units})`;
279
- }
280
- return (0, malloy_types_1.mkExpr) `TIMESTAMP(${sqlTime.value})`;
281
- }
282
- return (0, malloy_types_1.mkExpr) `TIMESTAMP_TRUNC(${sqlTime.value},${units})`;
283
- }
284
- sqlExtract(expr, units) {
285
- const extractTo = extractMap[units] || units;
286
- return (0, malloy_types_1.mkExpr) `EXTRACT(${extractTo} FROM ${expr.value})`;
287
- }
288
- sqlAlterTime(op, expr, n, timeframe) {
289
- let theTime = expr.value;
290
- let computeType = expr.valueType;
291
- if (timeframe != "day" && timestampAddUnits.includes(timeframe)) {
292
- // The units must be done in timestamp, no matter the input type
293
- computeType = "timestamp";
294
- if (expr.valueType != "timestamp") {
295
- theTime = (0, malloy_types_1.mkExpr) `TIMESTAMP(${theTime})`;
296
- }
297
- }
298
- else if (expr.valueType == "timestamp") {
299
- theTime = (0, malloy_types_1.mkExpr) `DATETIME(${theTime})`;
300
- computeType = "datetime";
301
- }
302
- const funcName = computeType.toUpperCase() + (op == "+" ? "_ADD" : "_SUB");
303
- const newTime = (0, malloy_types_1.mkExpr) `${funcName}(${theTime}, INTERVAL ${n} ${timeframe})`;
304
- return computeType == "datetime" ? (0, malloy_types_1.mkExpr) `TIMESTAMP(${newTime})` : newTime;
305
- }
306
- ignoreInProject(fieldName) {
307
- return fieldName === "_PARTITIONTIME";
308
- }
309
- sqlCast(cast) {
310
- if (cast.srcType !== cast.dstType) {
311
- const dstType = castMap[cast.dstType] || cast.dstType;
312
- // This just makes the code look a little prettier ...
313
- if (!cast.safe && cast.srcType && (0, malloy_types_1.isTimeFieldType)(cast.srcType)) {
314
- if (dstType == "date") {
315
- return (0, malloy_types_1.mkExpr) `DATE(${cast.expr})`;
316
- }
317
- return (0, malloy_types_1.mkExpr) `TIMESTAMP(${cast.expr})`;
318
- }
319
- const castFunc = cast.safe ? "SAFE_CAST" : "CAST";
320
- return (0, malloy_types_1.mkExpr) `${castFunc}(${cast.expr} AS ${dstType})`;
321
- }
322
- return cast.expr;
323
- }
324
- sqlRegexpMatch(expr, regexp) {
325
- return (0, malloy_types_1.mkExpr) `REGEXP_CONTAINS(${expr}, r${regexp})`;
326
- }
327
- sqlLiteralTime(timeString, type, timezone) {
328
- if (type === "date") {
329
- return `DATE('${timeString}')`;
330
- }
331
- else if (type === "timestamp") {
332
- return `TIMESTAMP('${timeString}', '${timezone}')`;
333
- }
334
- else {
335
- throw new Error(`Unknown Liternal time format ${type}`);
336
- }
337
- }
338
- sqlMeasureTime(from, to, units) {
339
- let lVal = from.value;
340
- let rVal = to.value;
341
- let diffUsing = "TIMESTAMP_DIFF";
342
- if (units == "second" || units == "minute" || units == "hour") {
343
- if (from.valueType != "timestamp") {
344
- lVal = (0, malloy_types_1.mkExpr) `TIMESTAMP(${lVal})`;
345
- }
346
- if (to.valueType != "timestamp") {
347
- rVal = (0, malloy_types_1.mkExpr) `TIMESTAMP(${rVal})`;
348
- }
349
- }
350
- else {
351
- diffUsing = "DATE_DIFF";
352
- if (from.valueType != "date") {
353
- lVal = (0, malloy_types_1.mkExpr) `DATE(${lVal})`;
354
- }
355
- if (to.valueType != "date") {
356
- rVal = (0, malloy_types_1.mkExpr) `DATE(${rVal})`;
357
- }
358
- }
359
- return (0, malloy_types_1.mkExpr) `${diffUsing}(${rVal}, ${lVal}, ${units})`;
360
- }
361
- sqlSampleTable(tableSQL, sample) {
362
- if (sample !== undefined) {
363
- if ((0, malloy_types_1.isSamplingEnable)(sample) && sample.enable) {
364
- sample = this.defaultSampling;
365
- }
366
- if ((0, malloy_types_1.isSamplingRows)(sample)) {
367
- throw new Error(`StandardSQL doesn't support sampling by rows only percent`);
368
- }
369
- else if ((0, malloy_types_1.isSamplingPercent)(sample)) {
370
- return `(SELECT * FROM ${tableSQL} TABLESAMPLE SYSTEM (${sample.percent} PERCENT))`;
371
- }
372
- }
373
- return tableSQL;
374
- }
375
- sqlLiteralString(literal) {
376
- const noVirgule = literal.replace(/\\/g, "\\\\");
377
- return "'" + noVirgule.replace(/'/g, "\\'") + "'";
378
- }
379
- }
380
- exports.StandardSQLDialect = StandardSQLDialect;
381
- //# sourceMappingURL=standardsql.js.map
package/dist/index.d.ts DELETED
@@ -1,10 +0,0 @@
1
- export type { QueryDataRow, Fragment, StructDef, StructRelationship, NamedStructDefs, MalloyQueryData, AtomicFieldType as AtomicFieldTypeInner, DateUnit, ExtractUnit, TimestampUnit, TimeFieldType, QueryData, FieldTypeDef, Expr, DialectFragment, TimeValue, FilterExpression, SQLBlock, FieldDef, FilteredAliasedName, PipeSegment, QueryFieldDef, TurtleDef, SearchValueMapResult, SearchIndexResult, ModelDef, Query, NamedQuery, NamedModelObject, ExpressionType, } from "./model";
2
- export { Segment, isFilteredAliasedName, flattenQuery, expressionIsCalculation, } from "./model";
3
- export { HighlightType, MalloyTranslator, } from "./lang";
4
- export type { LogMessage, TranslateResponse } from "./lang";
5
- export { Malloy, Runtime, AtomicFieldType, ConnectionRuntime, SingleConnectionRuntime, EmptyURLReader, InMemoryURLReader, FixedConnectionMap, MalloyError, JoinRelationship, SourceRelationship, DateTimeframe, TimestampTimeframe, Result, parseTableURI, QueryMaterializer, CSVWriter, JSONWriter, DataWriter, } from "./malloy";
6
- export type { Explore, Model, PreparedQuery, PreparedResult, Field, AtomicField, ExploreField, QueryField, DataArray, DataRecord, DataColumn, DataArrayOrRecord, ModelMaterializer, DocumentSymbol, DocumentHighlight, ResultJSON, PreparedResultMaterializer, SQLBlockMaterializer, ExploreMaterializer, WriteStream, } from "./malloy";
7
- export type { RunSQLOptions } from "./run_sql_options";
8
- export type { URLReader, InfoConnection, LookupConnection, Connection, QueryString, ModelString, QueryURL, ModelURL, PooledConnection, TestableConnection, PersistSQLResults, StreamingConnection, } from "./runtime_types";
9
- export type { Loggable } from "./malloy";
10
- export { toAsyncGenerator } from "./connection_utils";
package/dist/index.js DELETED
@@ -1,59 +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.toAsyncGenerator = exports.DataWriter = exports.JSONWriter = exports.CSVWriter = exports.QueryMaterializer = exports.parseTableURI = exports.Result = 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.expressionIsCalculation = exports.flattenQuery = exports.isFilteredAliasedName = exports.Segment = void 0;
26
- var model_1 = require("./model");
27
- // Used in Composer Demo
28
- Object.defineProperty(exports, "Segment", { enumerable: true, get: function () { return model_1.Segment; } });
29
- Object.defineProperty(exports, "isFilteredAliasedName", { enumerable: true, get: function () { return model_1.isFilteredAliasedName; } });
30
- Object.defineProperty(exports, "flattenQuery", { enumerable: true, get: function () { return model_1.flattenQuery; } });
31
- Object.defineProperty(exports, "expressionIsCalculation", { enumerable: true, get: function () { return model_1.expressionIsCalculation; } });
32
- var lang_1 = require("./lang");
33
- // Neede for VSCode extension
34
- Object.defineProperty(exports, "HighlightType", { enumerable: true, get: function () { return lang_1.HighlightType; } });
35
- // Needed for tests only
36
- Object.defineProperty(exports, "MalloyTranslator", { enumerable: true, get: function () { return lang_1.MalloyTranslator; } });
37
- var malloy_1 = require("./malloy");
38
- Object.defineProperty(exports, "Malloy", { enumerable: true, get: function () { return malloy_1.Malloy; } });
39
- Object.defineProperty(exports, "Runtime", { enumerable: true, get: function () { return malloy_1.Runtime; } });
40
- Object.defineProperty(exports, "AtomicFieldType", { enumerable: true, get: function () { return malloy_1.AtomicFieldType; } });
41
- Object.defineProperty(exports, "ConnectionRuntime", { enumerable: true, get: function () { return malloy_1.ConnectionRuntime; } });
42
- Object.defineProperty(exports, "SingleConnectionRuntime", { enumerable: true, get: function () { return malloy_1.SingleConnectionRuntime; } });
43
- Object.defineProperty(exports, "EmptyURLReader", { enumerable: true, get: function () { return malloy_1.EmptyURLReader; } });
44
- Object.defineProperty(exports, "InMemoryURLReader", { enumerable: true, get: function () { return malloy_1.InMemoryURLReader; } });
45
- Object.defineProperty(exports, "FixedConnectionMap", { enumerable: true, get: function () { return malloy_1.FixedConnectionMap; } });
46
- Object.defineProperty(exports, "MalloyError", { enumerable: true, get: function () { return malloy_1.MalloyError; } });
47
- Object.defineProperty(exports, "JoinRelationship", { enumerable: true, get: function () { return malloy_1.JoinRelationship; } });
48
- Object.defineProperty(exports, "SourceRelationship", { enumerable: true, get: function () { return malloy_1.SourceRelationship; } });
49
- Object.defineProperty(exports, "DateTimeframe", { enumerable: true, get: function () { return malloy_1.DateTimeframe; } });
50
- Object.defineProperty(exports, "TimestampTimeframe", { enumerable: true, get: function () { return malloy_1.TimestampTimeframe; } });
51
- Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return malloy_1.Result; } });
52
- Object.defineProperty(exports, "parseTableURI", { enumerable: true, get: function () { return malloy_1.parseTableURI; } });
53
- Object.defineProperty(exports, "QueryMaterializer", { enumerable: true, get: function () { return malloy_1.QueryMaterializer; } });
54
- Object.defineProperty(exports, "CSVWriter", { enumerable: true, get: function () { return malloy_1.CSVWriter; } });
55
- Object.defineProperty(exports, "JSONWriter", { enumerable: true, get: function () { return malloy_1.JSONWriter; } });
56
- Object.defineProperty(exports, "DataWriter", { enumerable: true, get: function () { return malloy_1.DataWriter; } });
57
- var connection_utils_1 = require("./connection_utils");
58
- Object.defineProperty(exports, "toAsyncGenerator", { enumerable: true, get: function () { return connection_utils_1.toAsyncGenerator; } });
59
- //# sourceMappingURL=index.js.map
@@ -1,3 +0,0 @@
1
- import { Expr } from "../../model/malloy_types";
2
- import { Equality } from "./ast-types";
3
- export declare function nullsafeNot(expr: Expr, op?: Equality): Expr;
@@ -1,34 +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.nullsafeNot = void 0;
26
- const malloy_types_1 = require("../../model/malloy_types");
27
- function nullsafeNot(expr, op) {
28
- if (op === undefined || op === "!=" || op === "!~") {
29
- return (0, malloy_types_1.mkExpr) `COALESCE(NOT(${expr}),FALSE)`;
30
- }
31
- return expr;
32
- }
33
- exports.nullsafeNot = nullsafeNot;
34
- //# sourceMappingURL=apply-expr.js.map