@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,364 +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.DuckDBDialect = void 0;
26
- const malloy_types_1 = require("../model/malloy_types");
27
- const utils_1 = require("../model/utils");
28
- const dialect_1 = require("./dialect");
29
- // need to refactor runSQL to take a SQLBlock instead of just a sql string.
30
- const hackSplitComment = "-- hack: split on this";
31
- const keywords = `
32
- ALL
33
- ANALYSE
34
- ANALYZE
35
- AND
36
- ANY
37
- ARRAY
38
- AS
39
- ASC_P
40
- ASYMMETRIC
41
- BOTH
42
- CASE
43
- CAST
44
- CHECK_P
45
- COLLATE
46
- COLUMN
47
- CONSTRAINT
48
- CREATE_P
49
- CURRENT_CATALOG
50
- CURRENT_DATE
51
- CURRENT_ROLE
52
- CURRENT_TIME
53
- CURRENT_TIMESTAMP
54
- CURRENT_USER
55
- DEFAULT
56
- DEFERRABLE
57
- DESC_P
58
- DISTINCT
59
- DO
60
- ELSE
61
- END_P
62
- EXCEPT
63
- FALSE_P
64
- FETCH
65
- FOR
66
- FOREIGN
67
- FROM
68
- GRANT
69
- GROUP_P
70
- HAVING
71
- IN_P
72
- INITIALLY
73
- INTERSECT
74
- INTO
75
- LATERAL_P
76
- LEADING
77
- LIMIT
78
- LOCALTIME
79
- LOCALTIMESTAMP
80
- NOT
81
- NULL_P
82
- OFFSET
83
- ON
84
- ONLY
85
- OR
86
- ORDER
87
- PLACING
88
- PRIMARY
89
- REFERENCES
90
- RETURNING
91
- SELECT
92
- SESSION_USER
93
- SOME
94
- SYMMETRIC
95
- TABLE
96
- THEN
97
- TO
98
- TRAILING
99
- TRUE_P
100
- UNION
101
- UNIQUE
102
- USER
103
- USING
104
- VARIADIC
105
- WHEN
106
- WHERE
107
- WINDOW
108
- WITH
109
- `.split(/\s/);
110
- const castMap = {
111
- number: "double precision",
112
- string: "varchar",
113
- };
114
- const pgExtractionMap = {
115
- day_of_week: "dow",
116
- day_of_year: "doy",
117
- };
118
- const inSeconds = {
119
- second: 1,
120
- minute: 60,
121
- hour: 3600,
122
- };
123
- class DuckDBDialect extends dialect_1.Dialect {
124
- constructor() {
125
- super(...arguments);
126
- this.name = "duckdb";
127
- this.defaultNumberType = "DOUBLE";
128
- this.hasFinalStage = false;
129
- this.stringTypeName = "VARCHAR";
130
- this.divisionIsInteger = true;
131
- this.supportsSumDistinctFunction = true;
132
- this.unnestWithNumbers = true;
133
- this.defaultSampling = { rows: 50000 };
134
- this.supportUnnestArrayAgg = true;
135
- this.supportsCTEinCoorelatedSubQueries = true;
136
- this.dontUnionIndex = false;
137
- this.supportsQualify = true;
138
- this.functionInfo = {
139
- concat: { returnType: "string" },
140
- };
141
- }
142
- // hack until they support temporary macros.
143
- get udfPrefix() {
144
- return `__udf${Math.floor(Math.random() * 100000)}`;
145
- }
146
- quoteTablePath(tableName) {
147
- return tableName.match(/\//) ? `'${tableName}'` : tableName;
148
- }
149
- sqlGroupSetTable(groupSetCount) {
150
- return `CROSS JOIN (SELECT UNNEST(GENERATE_SERIES(0,${groupSetCount},1)) as group_set ) as group_set`;
151
- }
152
- sqlAnyValue(groupSet, fieldName) {
153
- return `FIRST(${fieldName}) FILTER (WHERE ${fieldName} IS NOT NULL)`;
154
- }
155
- mapFields(fieldList) {
156
- return fieldList.join(", ");
157
- }
158
- sqlAggregateTurtle(groupSet, fieldList, orderBy, limit) {
159
- let tail = "";
160
- if (limit !== undefined) {
161
- tail += `[1:${limit}]`;
162
- }
163
- const fields = fieldList
164
- .map((f) => `\n ${f.sqlOutputName}: ${f.sqlExpression}`)
165
- .join(", ");
166
- return `COALESCE(LIST({${fields}} ${orderBy}) FILTER (WHERE group_set=${groupSet})${tail},[])`;
167
- }
168
- sqlAnyValueTurtle(groupSet, fieldList) {
169
- const fields = fieldList
170
- .map((f) => `${f.sqlExpression} as ${f.sqlOutputName}`)
171
- .join(", ");
172
- return `ANY_VALUE(CASE WHEN group_set=${groupSet} THEN ROW(${fields}))`;
173
- }
174
- sqlAnyValueLastTurtle(name, groupSet, sqlName) {
175
- return `MAX(CASE WHEN group_set=${groupSet} THEN ${name}__${groupSet} END) as ${sqlName}`;
176
- }
177
- sqlCoaleseMeasuresInline(groupSet, fieldList) {
178
- const fields = fieldList
179
- .map((f) => `${f.sqlOutputName}: ${f.sqlExpression} `)
180
- .join(", ");
181
- const nullValues = fieldList
182
- .map((f) => `${f.sqlOutputName}: NULL`)
183
- .join(", ");
184
- return `COALESCE(FIRST({${fields}}) FILTER(WHERE group_set=${groupSet}), {${nullValues}})`;
185
- }
186
- sqlUnnestAlias(source, alias, _fieldList, _needDistinctKey) {
187
- return `LEFT JOIN (select UNNEST(generate_series(1,
188
- 100000, --
189
- -- (SELECT genres_length FROM movies limit 1),
190
- 1)) as __row_id) as ${alias} ON ${alias}.__row_id <= array_length(${source})`;
191
- // When DuckDB supports lateral joins...
192
- //return `,(select UNNEST(generate_series(1, length(${source}),1))) as ${alias}(__row_id)`;
193
- }
194
- sqlSumDistinctHashedKey(_sqlDistinctKey) {
195
- return "uses sumDistinctFunction, should not be called";
196
- }
197
- sqlGenerateUUID() {
198
- return `GEN_RANDOM_UUID()`;
199
- }
200
- sqlDateToString(sqlDateExp) {
201
- return `(${sqlDateExp})::date::varchar`;
202
- }
203
- sqlFieldReference(alias, fieldName, _fieldType, _isNested, isArray) {
204
- if (isArray) {
205
- return alias;
206
- }
207
- else {
208
- return `${alias}.${this.sqlMaybeQuoteIdentifier(fieldName)}`;
209
- }
210
- }
211
- sqlUnnestPipelineHead(isSingleton, sourceSQLExpression) {
212
- let p = sourceSQLExpression;
213
- if (isSingleton) {
214
- p = `[${p}]`;
215
- }
216
- return `(SELECT UNNEST(${p}) as base)`;
217
- }
218
- sqlCreateFunction(id, funcText) {
219
- return `DROP MACRO IF EXISTS ${id}; \n${hackSplitComment}\n CREATE MACRO ${id}(_param) AS (\n${(0, utils_1.indent)(funcText)}\n);\n${hackSplitComment}\n`;
220
- }
221
- sqlCreateFunctionCombineLastStage(lastStageName, structDef) {
222
- return `SELECT LIST(ROW(${structDef.fields
223
- .map((fieldDef) => this.sqlMaybeQuoteIdentifier((0, malloy_types_1.getIdentifier)(fieldDef)))
224
- .join(",")})) FROM ${lastStageName}\n`;
225
- }
226
- sqlSelectAliasAsStruct(alias, physicalFieldNames) {
227
- return `ROW(${physicalFieldNames
228
- .map((name) => `${alias}.${name}`)
229
- .join(", ")})`;
230
- }
231
- // TODO
232
- // sqlMaybeQuoteIdentifier(identifier: string): string {
233
- // return keywords.indexOf(identifier.toUpperCase()) > 0 ||
234
- // identifier.match(/[a-zA-Z][a-zA-Z0-9]*/) === null || true
235
- // ? '"' + identifier + '"'
236
- // : identifier;
237
- // }
238
- sqlMaybeQuoteIdentifier(identifier) {
239
- return '"' + identifier + '"';
240
- }
241
- // The simple way to do this is to add a comment on the table
242
- // with the expiration time. https://www.postgresql.org/docs/current/sql-comment.html
243
- // and have a reaper that read comments.
244
- sqlCreateTableAsSelect(_tableName, _sql) {
245
- throw new Error("Not implemented Yet");
246
- }
247
- getFunctionInfo(functionName) {
248
- return this.functionInfo[functionName];
249
- }
250
- sqlMeasureTime(from, to, units) {
251
- let lVal = from.value;
252
- let rVal = to.value;
253
- if (inSeconds[units]) {
254
- lVal = (0, malloy_types_1.mkExpr) `EXTRACT(EPOCH FROM ${lVal})`;
255
- rVal = (0, malloy_types_1.mkExpr) `EXTRACT(EPOCH FROM ${rVal})`;
256
- const duration = (0, malloy_types_1.mkExpr) `(${rVal} - ${lVal})`;
257
- return units == "second"
258
- ? duration
259
- : (0, malloy_types_1.mkExpr) `FLOOR(${duration}/${inSeconds[units].toString()})`;
260
- }
261
- if (from.valueType != "date") {
262
- lVal = (0, malloy_types_1.mkExpr) `CAST((${lVal}) AS DATE)`;
263
- }
264
- if (to.valueType != "date") {
265
- rVal = (0, malloy_types_1.mkExpr) `CAST((${rVal}) AS DATE)`;
266
- }
267
- if (units == "week") {
268
- // DuckDB's weeks start on Monday, but Malloy's weeks start on Sunday
269
- lVal = (0, malloy_types_1.mkExpr) `(${lVal} + INTERVAL 1 DAY)`;
270
- rVal = (0, malloy_types_1.mkExpr) `(${rVal} + INTERVAL 1 DAY)`;
271
- }
272
- return (0, malloy_types_1.mkExpr) `DATE_DIFF('${units}', ${lVal}, ${rVal})`;
273
- }
274
- sqlNow() {
275
- return (0, malloy_types_1.mkExpr) `CURRENT_TIMESTAMP::TIMESTAMP`;
276
- }
277
- sqlTrunc(sqlTime, units) {
278
- // adjusting for monday/sunday weeks
279
- const week = units == "week";
280
- const truncThis = week
281
- ? (0, malloy_types_1.mkExpr) `${sqlTime.value} + INTERVAL 1 DAY`
282
- : sqlTime.value;
283
- const trunced = (0, malloy_types_1.mkExpr) `DATE_TRUNC('${units}', ${truncThis})`;
284
- return week ? (0, malloy_types_1.mkExpr) `(${trunced} - INTERVAL 1 DAY)` : trunced;
285
- }
286
- sqlExtract(from, units) {
287
- const pgUnits = pgExtractionMap[units] || units;
288
- const extracted = (0, malloy_types_1.mkExpr) `EXTRACT(${pgUnits} FROM ${from.value})`;
289
- return units == "day_of_week" ? (0, malloy_types_1.mkExpr) `(${extracted}+1)` : extracted;
290
- }
291
- sqlAlterTime(op, expr, n, timeframe) {
292
- if (timeframe == "quarter") {
293
- timeframe = "month";
294
- n = (0, malloy_types_1.mkExpr) `${n}*3`;
295
- }
296
- if (timeframe == "week") {
297
- timeframe = "day";
298
- n = (0, malloy_types_1.mkExpr) `${n}*7`;
299
- }
300
- const interval = (0, malloy_types_1.mkExpr) `INTERVAL (${n}) ${timeframe}`;
301
- return (0, malloy_types_1.mkExpr) `((${expr.value})) ${op} ${interval}`;
302
- }
303
- sqlCast(cast) {
304
- if (cast.dstType !== cast.srcType) {
305
- const castTo = castMap[cast.dstType] || cast.dstType;
306
- return (0, malloy_types_1.mkExpr) `cast(${cast.expr} as ${castTo})`;
307
- }
308
- return cast.expr;
309
- }
310
- sqlRegexpMatch(expr, regexp) {
311
- return (0, malloy_types_1.mkExpr) `REGEXP_MATCHES(${expr}, ${regexp})`;
312
- }
313
- sqlLiteralTime(timeString, type, _timezone) {
314
- if (type == "date") {
315
- return `DATE '${timeString}'`;
316
- }
317
- else if (type == "timestamp") {
318
- return `TIMESTAMP '${timeString}'`;
319
- }
320
- else {
321
- throw new Error(`Unknown Literal time format ${type}`);
322
- }
323
- }
324
- sqlSumDistinct(key, value) {
325
- // return `sum_distinct(list({key:${key}, val: ${value}}))`;
326
- return `(
327
- SELECT sum(a.val) as value
328
- FROM (
329
- SELECT UNNEST(list(distinct {key:${key}, val: ${value}})) a
330
- )
331
- )`;
332
- }
333
- // sqlSumDistinct(key: string, value: string): string {
334
- // const _factor = 32;
335
- // const precision = 0.000001;
336
- // const keySQL = `md5_number_lower(${key}::varchar)::int128`;
337
- // return `
338
- // (SUM(DISTINCT ${keySQL} + FLOOR(IFNULL(${value},0)/${precision})::int128) - SUM(DISTINCT ${keySQL}))*${precision}
339
- // `;
340
- // }
341
- // default duckdb to sampling 50K rows.
342
- sqlSampleTable(tableSQL, sample) {
343
- if (sample !== undefined) {
344
- if ((0, malloy_types_1.isSamplingEnable)(sample) && sample.enable) {
345
- sample = this.defaultSampling;
346
- }
347
- if ((0, malloy_types_1.isSamplingRows)(sample)) {
348
- return `(SELECT * FROM ${tableSQL} USING SAMPLE ${sample.rows})`;
349
- }
350
- else if ((0, malloy_types_1.isSamplingPercent)(sample)) {
351
- return `(SELECT * FROM ${tableSQL} USING SAMPLE ${sample.percent} PERCENT (bernoulli))`;
352
- }
353
- }
354
- return tableSQL;
355
- }
356
- sqlOrderBy(orderTerms) {
357
- return `ORDER BY ${orderTerms.map((t) => `${t} NULLS LAST`).join(",")}`;
358
- }
359
- sqlLiteralString(literal) {
360
- return "'" + literal.replace(/'/g, "''") + "'";
361
- }
362
- }
363
- exports.DuckDBDialect = DuckDBDialect;
364
- //# sourceMappingURL=duckdb.js.map
@@ -1,6 +0,0 @@
1
- export { Dialect } from "./dialect";
2
- export type { DialectFieldList } from "./dialect";
3
- export { StandardSQLDialect } from "./standardsql";
4
- export { PostgresDialect } from "./postgres";
5
- export { DuckDBDialect } from "./duckdb";
6
- export { getDialect, registerDialect } from "./dialect_map";
@@ -1,37 +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.registerDialect = exports.getDialect = exports.DuckDBDialect = exports.PostgresDialect = exports.StandardSQLDialect = exports.Dialect = void 0;
26
- var dialect_1 = require("./dialect");
27
- Object.defineProperty(exports, "Dialect", { enumerable: true, get: function () { return dialect_1.Dialect; } });
28
- var standardsql_1 = require("./standardsql");
29
- Object.defineProperty(exports, "StandardSQLDialect", { enumerable: true, get: function () { return standardsql_1.StandardSQLDialect; } });
30
- var postgres_1 = require("./postgres");
31
- Object.defineProperty(exports, "PostgresDialect", { enumerable: true, get: function () { return postgres_1.PostgresDialect; } });
32
- var duckdb_1 = require("./duckdb");
33
- Object.defineProperty(exports, "DuckDBDialect", { enumerable: true, get: function () { return duckdb_1.DuckDBDialect; } });
34
- var dialect_map_1 = require("./dialect_map");
35
- Object.defineProperty(exports, "getDialect", { enumerable: true, get: function () { return dialect_map_1.getDialect; } });
36
- Object.defineProperty(exports, "registerDialect", { enumerable: true, get: function () { return dialect_map_1.registerDialect; } });
37
- //# sourceMappingURL=index.js.map
@@ -1,52 +0,0 @@
1
- import { DateUnit, ExtractUnit, TimeFieldType, TimestampUnit, Expr, TimeValue, TypecastFragment, Sampling } from "../model/malloy_types";
2
- import { Dialect, DialectFieldList, FunctionInfo } from "./dialect";
3
- export declare class PostgresDialect extends Dialect {
4
- name: string;
5
- defaultNumberType: string;
6
- udfPrefix: string;
7
- hasFinalStage: boolean;
8
- stringTypeName: string;
9
- divisionIsInteger: boolean;
10
- supportsSumDistinctFunction: boolean;
11
- unnestWithNumbers: boolean;
12
- defaultSampling: {
13
- rows: number;
14
- };
15
- supportUnnestArrayAgg: boolean;
16
- supportsCTEinCoorelatedSubQueries: boolean;
17
- dontUnionIndex: boolean;
18
- supportsQualify: boolean;
19
- functionInfo: Record<string, FunctionInfo>;
20
- quoteTablePath(tablePath: string): string;
21
- sqlGroupSetTable(groupSetCount: number): string;
22
- sqlAnyValue(groupSet: number, fieldName: string): string;
23
- mapFields(fieldList: DialectFieldList): string;
24
- sqlAggregateTurtle(groupSet: number, fieldList: DialectFieldList, orderBy: string | undefined, limit: number | undefined): string;
25
- sqlAnyValueTurtle(groupSet: number, fieldList: DialectFieldList): string;
26
- sqlAnyValueLastTurtle(name: string, groupSet: number, sqlName: string): string;
27
- sqlCoaleseMeasuresInline(groupSet: number, fieldList: DialectFieldList): string;
28
- sqlUnnestAlias(source: string, alias: string, fieldList: DialectFieldList, needDistinctKey: boolean, isArray: boolean): string;
29
- sqlSumDistinctHashedKey(sqlDistinctKey: string): string;
30
- sqlGenerateUUID(): string;
31
- sqlFieldReference(alias: string, fieldName: string, fieldType: string, isNested: boolean, _isArray: boolean): string;
32
- sqlUnnestPipelineHead(isSingleton: boolean, sourceSQLExpression: string): string;
33
- sqlCreateFunction(id: string, funcText: string): string;
34
- sqlCreateFunctionCombineLastStage(lastStageName: string): string;
35
- sqlFinalStage(lastStageName: string, _fields: string[]): string;
36
- sqlSelectAliasAsStruct(alias: string): string;
37
- sqlMaybeQuoteIdentifier(identifier: string): string;
38
- sqlCreateTableAsSelect(_tableName: string, _sql: string): string;
39
- sqlNow(): Expr;
40
- sqlTrunc(sqlTime: TimeValue, units: TimestampUnit): Expr;
41
- sqlExtract(from: TimeValue, units: ExtractUnit): Expr;
42
- sqlAlterTime(op: "+" | "-", expr: TimeValue, n: Expr, timeframe: DateUnit): Expr;
43
- sqlCast(cast: TypecastFragment): Expr;
44
- sqlRegexpMatch(expr: Expr, regexp: string): Expr;
45
- sqlLiteralTime(timeString: string, type: TimeFieldType, _timezone: string): string;
46
- getFunctionInfo(functionName: string): FunctionInfo | undefined;
47
- sqlMeasureTime(from: TimeValue, to: TimeValue, units: string): Expr;
48
- sqlSumDistinct(key: string, value: string): string;
49
- sqlSampleTable(tableSQL: string, sample: Sampling | undefined): string;
50
- sqlOrderBy(orderTerms: string[]): string;
51
- sqlLiteralString(literal: string): string;
52
- }