@malloydata/malloy 0.0.182-dev240911155850 → 0.0.182-dev240912152159
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/dialect.d.ts +3 -1
- package/dist/dialect/dialect_map.d.ts +1 -2
- package/dist/dialect/dialect_map.js +5 -74
- package/dist/dialect/duckdb/dialect_functions.d.ts +2 -0
- package/dist/dialect/duckdb/dialect_functions.js +67 -0
- package/dist/dialect/duckdb/duckdb.d.ts +3 -1
- package/dist/dialect/duckdb/duckdb.js +6 -5
- package/dist/dialect/duckdb/function_overrides.d.ts +2 -0
- package/dist/dialect/duckdb/function_overrides.js +55 -0
- package/dist/dialect/functions/index.d.ts +3 -1
- package/dist/dialect/functions/index.js +6 -3
- package/dist/dialect/functions/malloy_standard_functions.d.ts +134 -0
- package/dist/dialect/functions/malloy_standard_functions.js +612 -0
- package/dist/dialect/functions/util.d.ts +78 -2
- package/dist/dialect/functions/util.js +257 -3
- package/dist/dialect/index.d.ts +5 -4
- package/dist/dialect/index.js +3 -4
- package/dist/dialect/postgres/dialect_functions.d.ts +2 -0
- package/dist/dialect/postgres/dialect_functions.js +51 -0
- package/dist/dialect/postgres/function_overrides.d.ts +2 -0
- package/dist/dialect/postgres/function_overrides.js +73 -0
- package/dist/dialect/postgres/postgres.d.ts +3 -2
- package/dist/dialect/postgres/postgres.js +6 -6
- package/dist/dialect/snowflake/dialect_functions.d.ts +2 -0
- package/dist/dialect/snowflake/dialect_functions.js +57 -0
- package/dist/dialect/snowflake/function_overrides.d.ts +2 -0
- package/dist/dialect/snowflake/function_overrides.js +39 -0
- package/dist/dialect/snowflake/snowflake.d.ts +3 -2
- package/dist/dialect/snowflake/snowflake.js +6 -6
- package/dist/dialect/standardsql/dialect_functions.d.ts +2 -0
- package/dist/dialect/standardsql/dialect_functions.js +65 -0
- package/dist/dialect/standardsql/function_overrides.d.ts +2 -0
- package/dist/dialect/standardsql/function_overrides.js +17 -0
- package/dist/dialect/standardsql/standardsql.d.ts +3 -1
- package/dist/dialect/standardsql/standardsql.js +6 -5
- package/dist/dialect/trino/dialect_functions.d.ts +2 -0
- package/dist/dialect/trino/dialect_functions.js +63 -0
- package/dist/dialect/trino/function_overrides.d.ts +2 -0
- package/dist/dialect/trino/function_overrides.js +50 -0
- package/dist/dialect/trino/trino.d.ts +3 -1
- package/dist/dialect/trino/trino.js +6 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -4
- package/dist/lang/ast/expressions/expr-func.js +25 -29
- package/dist/lang/ast/types/dialect-name-space.js +5 -5
- package/dist/lang/ast/types/global-name-space.d.ts +4 -2
- package/dist/lang/ast/types/global-name-space.js +59 -6
- package/dist/model/malloy_query.d.ts +1 -1
- package/dist/model/malloy_query.js +7 -6
- package/dist/model/malloy_types.d.ts +7 -7
- package/package.json +1 -1
- package/dist/dialect/duckdb/functions/byte_length.d.ts +0 -2
- package/dist/dialect/duckdb/functions/byte_length.js +0 -33
- package/dist/dialect/duckdb/functions/count_approx.d.ts +0 -2
- package/dist/dialect/duckdb/functions/count_approx.js +0 -20
- package/dist/dialect/duckdb/functions/dialect_functions.d.ts +0 -4
- package/dist/dialect/duckdb/functions/dialect_functions.js +0 -16
- package/dist/dialect/duckdb/functions/div.d.ts +0 -2
- package/dist/dialect/duckdb/functions/div.js +0 -38
- package/dist/dialect/duckdb/functions/duckdb_functions.d.ts +0 -1
- package/dist/dialect/duckdb/functions/duckdb_functions.js +0 -54
- package/dist/dialect/duckdb/functions/ends_with.d.ts +0 -2
- package/dist/dialect/duckdb/functions/ends_with.js +0 -35
- package/dist/dialect/duckdb/functions/greatest_and_least.d.ts +0 -3
- package/dist/dialect/duckdb/functions/greatest_and_least.js +0 -51
- package/dist/dialect/duckdb/functions/index.d.ts +0 -1
- package/dist/dialect/duckdb/functions/index.js +0 -28
- package/dist/dialect/duckdb/functions/is_inf.d.ts +0 -2
- package/dist/dialect/duckdb/functions/is_inf.js +0 -33
- package/dist/dialect/duckdb/functions/is_nan.d.ts +0 -2
- package/dist/dialect/duckdb/functions/is_nan.js +0 -33
- package/dist/dialect/duckdb/functions/log.d.ts +0 -2
- package/dist/dialect/duckdb/functions/log.js +0 -38
- package/dist/dialect/duckdb/functions/rand.d.ts +0 -2
- package/dist/dialect/duckdb/functions/rand.js +0 -31
- package/dist/dialect/duckdb/functions/replace.d.ts +0 -2
- package/dist/dialect/duckdb/functions/replace.js +0 -40
- package/dist/dialect/duckdb/functions/trunc.d.ts +0 -2
- package/dist/dialect/duckdb/functions/trunc.js +0 -39
- package/dist/dialect/duckdb/functions/unicode.d.ts +0 -2
- package/dist/dialect/duckdb/functions/unicode.js +0 -35
- package/dist/dialect/functions/all_functions.d.ts +0 -8
- package/dist/dialect/functions/all_functions.js +0 -146
- package/dist/dialect/functions/atan2.d.ts +0 -2
- package/dist/dialect/functions/atan2.js +0 -33
- package/dist/dialect/functions/avg_moving.d.ts +0 -2
- package/dist/dialect/functions/avg_moving.js +0 -46
- package/dist/dialect/functions/chr.d.ts +0 -4
- package/dist/dialect/functions/chr.js +0 -45
- package/dist/dialect/functions/coalesce.d.ts +0 -2
- package/dist/dialect/functions/coalesce.js +0 -38
- package/dist/dialect/functions/concat.d.ts +0 -2
- package/dist/dialect/functions/concat.js +0 -38
- package/dist/dialect/functions/div.d.ts +0 -2
- package/dist/dialect/functions/div.js +0 -36
- package/dist/dialect/functions/first_value_window.d.ts +0 -3
- package/dist/dialect/functions/first_value_window.js +0 -49
- package/dist/dialect/functions/function_map.d.ts +0 -16
- package/dist/dialect/functions/function_map.js +0 -72
- package/dist/dialect/functions/greatest_and_least.d.ts +0 -3
- package/dist/dialect/functions/greatest_and_least.js +0 -44
- package/dist/dialect/functions/ifnull.d.ts +0 -2
- package/dist/dialect/functions/ifnull.js +0 -38
- package/dist/dialect/functions/is_inf.d.ts +0 -2
- package/dist/dialect/functions/is_inf.js +0 -33
- package/dist/dialect/functions/is_nan.d.ts +0 -2
- package/dist/dialect/functions/is_nan.js +0 -33
- package/dist/dialect/functions/lag.d.ts +0 -2
- package/dist/dialect/functions/lag.js +0 -53
- package/dist/dialect/functions/lead.d.ts +0 -2
- package/dist/dialect/functions/lead.js +0 -50
- package/dist/dialect/functions/length.d.ts +0 -3
- package/dist/dialect/functions/length.js +0 -40
- package/dist/dialect/functions/log.d.ts +0 -2
- package/dist/dialect/functions/log.js +0 -35
- package/dist/dialect/functions/lower.d.ts +0 -2
- package/dist/dialect/functions/lower.js +0 -34
- package/dist/dialect/functions/nullif.d.ts +0 -2
- package/dist/dialect/functions/nullif.js +0 -42
- package/dist/dialect/functions/pi.d.ts +0 -2
- package/dist/dialect/functions/pi.js +0 -31
- package/dist/dialect/functions/pow.d.ts +0 -2
- package/dist/dialect/functions/pow.js +0 -35
- package/dist/dialect/functions/rand.d.ts +0 -2
- package/dist/dialect/functions/rand.js +0 -31
- package/dist/dialect/functions/rank.d.ts +0 -2
- package/dist/dialect/functions/rank.js +0 -36
- package/dist/dialect/functions/regexp_extract.d.ts +0 -2
- package/dist/dialect/functions/regexp_extract.js +0 -41
- package/dist/dialect/functions/repeat.d.ts +0 -2
- package/dist/dialect/functions/repeat.js +0 -35
- package/dist/dialect/functions/replace.d.ts +0 -2
- package/dist/dialect/functions/replace.js +0 -42
- package/dist/dialect/functions/reverse.d.ts +0 -2
- package/dist/dialect/functions/reverse.js +0 -34
- package/dist/dialect/functions/round.d.ts +0 -2
- package/dist/dialect/functions/round.js +0 -40
- package/dist/dialect/functions/row_number.d.ts +0 -2
- package/dist/dialect/functions/row_number.js +0 -40
- package/dist/dialect/functions/simple_numeric_functions.d.ts +0 -15
- package/dist/dialect/functions/simple_numeric_functions.js +0 -60
- package/dist/dialect/functions/sql.d.ts +0 -6
- package/dist/dialect/functions/sql.js +0 -52
- package/dist/dialect/functions/starts_ends_with.d.ts +0 -3
- package/dist/dialect/functions/starts_ends_with.js +0 -43
- package/dist/dialect/functions/stddev.d.ts +0 -2
- package/dist/dialect/functions/stddev.js +0 -34
- package/dist/dialect/functions/string_agg.d.ts +0 -3
- package/dist/dialect/functions/string_agg.js +0 -55
- package/dist/dialect/functions/strpos.d.ts +0 -2
- package/dist/dialect/functions/strpos.js +0 -35
- package/dist/dialect/functions/substr.d.ts +0 -2
- package/dist/dialect/functions/substr.js +0 -37
- package/dist/dialect/functions/sum_min_max_window.d.ts +0 -7
- package/dist/dialect/functions/sum_min_max_window.js +0 -94
- package/dist/dialect/functions/sum_moving.d.ts +0 -2
- package/dist/dialect/functions/sum_moving.js +0 -43
- package/dist/dialect/functions/trim_functions.d.ts +0 -4
- package/dist/dialect/functions/trim_functions.js +0 -42
- package/dist/dialect/functions/trunc.d.ts +0 -2
- package/dist/dialect/functions/trunc.js +0 -38
- package/dist/dialect/functions/upper.d.ts +0 -2
- package/dist/dialect/functions/upper.js +0 -34
- package/dist/dialect/postgres/functions/byte_length.d.ts +0 -2
- package/dist/dialect/postgres/functions/byte_length.js +0 -33
- package/dist/dialect/postgres/functions/dialect_functions.d.ts +0 -4
- package/dist/dialect/postgres/functions/dialect_functions.js +0 -11
- package/dist/dialect/postgres/functions/ends_with.d.ts +0 -2
- package/dist/dialect/postgres/functions/ends_with.js +0 -38
- package/dist/dialect/postgres/functions/greatest_and_least.d.ts +0 -3
- package/dist/dialect/postgres/functions/greatest_and_least.js +0 -43
- package/dist/dialect/postgres/functions/ifnull.d.ts +0 -2
- package/dist/dialect/postgres/functions/ifnull.js +0 -40
- package/dist/dialect/postgres/functions/index.d.ts +0 -1
- package/dist/dialect/postgres/functions/index.js +0 -28
- package/dist/dialect/postgres/functions/is_inf.d.ts +0 -2
- package/dist/dialect/postgres/functions/is_inf.js +0 -34
- package/dist/dialect/postgres/functions/is_nan.d.ts +0 -2
- package/dist/dialect/postgres/functions/is_nan.js +0 -33
- package/dist/dialect/postgres/functions/log.d.ts +0 -2
- package/dist/dialect/postgres/functions/log.js +0 -37
- package/dist/dialect/postgres/functions/postgres_functions.d.ts +0 -1
- package/dist/dialect/postgres/functions/postgres_functions.js +0 -63
- package/dist/dialect/postgres/functions/rand.d.ts +0 -2
- package/dist/dialect/postgres/functions/rand.js +0 -31
- package/dist/dialect/postgres/functions/regexp_extract.d.ts +0 -2
- package/dist/dialect/postgres/functions/regexp_extract.js +0 -35
- package/dist/dialect/postgres/functions/replace.d.ts +0 -2
- package/dist/dialect/postgres/functions/replace.js +0 -40
- package/dist/dialect/postgres/functions/round.d.ts +0 -2
- package/dist/dialect/postgres/functions/round.js +0 -39
- package/dist/dialect/postgres/functions/stddev.d.ts +0 -2
- package/dist/dialect/postgres/functions/stddev.js +0 -37
- package/dist/dialect/postgres/functions/string_agg.d.ts +0 -3
- package/dist/dialect/postgres/functions/string_agg.js +0 -55
- package/dist/dialect/postgres/functions/substr.d.ts +0 -2
- package/dist/dialect/postgres/functions/substr.js +0 -38
- package/dist/dialect/postgres/functions/trunc.d.ts +0 -2
- package/dist/dialect/postgres/functions/trunc.js +0 -40
- package/dist/dialect/postgres/functions/unicode.d.ts +0 -2
- package/dist/dialect/postgres/functions/unicode.js +0 -34
- package/dist/dialect/snowflake/functions/chr.d.ts +0 -2
- package/dist/dialect/snowflake/functions/chr.js +0 -36
- package/dist/dialect/snowflake/functions/dialect_functions.d.ts +0 -4
- package/dist/dialect/snowflake/functions/dialect_functions.js +0 -11
- package/dist/dialect/snowflake/functions/div.d.ts +0 -2
- package/dist/dialect/snowflake/functions/div.js +0 -37
- package/dist/dialect/snowflake/functions/index.d.ts +0 -1
- package/dist/dialect/snowflake/functions/index.js +0 -28
- package/dist/dialect/snowflake/functions/is_inf.d.ts +0 -2
- package/dist/dialect/snowflake/functions/is_inf.js +0 -34
- package/dist/dialect/snowflake/functions/is_nan.d.ts +0 -2
- package/dist/dialect/snowflake/functions/is_nan.js +0 -33
- package/dist/dialect/snowflake/functions/length.d.ts +0 -3
- package/dist/dialect/snowflake/functions/length.js +0 -39
- package/dist/dialect/snowflake/functions/log.d.ts +0 -2
- package/dist/dialect/snowflake/functions/log.js +0 -37
- package/dist/dialect/snowflake/functions/rand.d.ts +0 -2
- package/dist/dialect/snowflake/functions/rand.js +0 -33
- package/dist/dialect/snowflake/functions/regexp_extract.d.ts +0 -2
- package/dist/dialect/snowflake/functions/regexp_extract.js +0 -35
- package/dist/dialect/snowflake/functions/snowflake_functions.d.ts +0 -1
- package/dist/dialect/snowflake/functions/snowflake_functions.js +0 -56
- package/dist/dialect/snowflake/functions/starts_ends_with.d.ts +0 -3
- package/dist/dialect/snowflake/functions/starts_ends_with.js +0 -43
- package/dist/dialect/snowflake/functions/string_agg.d.ts +0 -3
- package/dist/dialect/snowflake/functions/string_agg.js +0 -55
- package/dist/dialect/snowflake/functions/strpos.d.ts +0 -2
- package/dist/dialect/snowflake/functions/strpos.js +0 -35
- package/dist/dialect/snowflake/functions/trunc.d.ts +0 -2
- package/dist/dialect/snowflake/functions/trunc.js +0 -39
- package/dist/dialect/standardsql/functions/chr.d.ts +0 -2
- package/dist/dialect/standardsql/functions/chr.js +0 -37
- package/dist/dialect/standardsql/functions/dialect_functions.d.ts +0 -4
- package/dist/dialect/standardsql/functions/dialect_functions.js +0 -16
- package/dist/dialect/standardsql/functions/index.d.ts +0 -1
- package/dist/dialect/standardsql/functions/index.js +0 -28
- package/dist/dialect/standardsql/functions/pi.d.ts +0 -2
- package/dist/dialect/standardsql/functions/pi.js +0 -32
- package/dist/dialect/standardsql/functions/standardsql_functions.d.ts +0 -1
- package/dist/dialect/standardsql/functions/standardsql_functions.js +0 -36
- package/dist/dialect/standardsql/functions/string_agg.d.ts +0 -3
- package/dist/dialect/standardsql/functions/string_agg.js +0 -59
- package/dist/dialect/trino/functions/byte_length.d.ts +0 -2
- package/dist/dialect/trino/functions/byte_length.js +0 -33
- package/dist/dialect/trino/functions/chr.d.ts +0 -4
- package/dist/dialect/trino/functions/chr.js +0 -45
- package/dist/dialect/trino/functions/concat.d.ts +0 -2
- package/dist/dialect/trino/functions/concat.js +0 -38
- package/dist/dialect/trino/functions/count_approx.d.ts +0 -2
- package/dist/dialect/trino/functions/count_approx.js +0 -20
- package/dist/dialect/trino/functions/dialect_functions.d.ts +0 -4
- package/dist/dialect/trino/functions/dialect_functions.js +0 -16
- package/dist/dialect/trino/functions/div.d.ts +0 -2
- package/dist/dialect/trino/functions/div.js +0 -36
- package/dist/dialect/trino/functions/ifnull.d.ts +0 -2
- package/dist/dialect/trino/functions/ifnull.js +0 -40
- package/dist/dialect/trino/functions/index.d.ts +0 -1
- package/dist/dialect/trino/functions/index.js +0 -28
- package/dist/dialect/trino/functions/is_inf.d.ts +0 -2
- package/dist/dialect/trino/functions/is_inf.js +0 -33
- package/dist/dialect/trino/functions/log.d.ts +0 -2
- package/dist/dialect/trino/functions/log.js +0 -37
- package/dist/dialect/trino/functions/repeat.d.ts +0 -2
- package/dist/dialect/trino/functions/repeat.js +0 -35
- package/dist/dialect/trino/functions/reverse.d.ts +0 -2
- package/dist/dialect/trino/functions/reverse.js +0 -34
- package/dist/dialect/trino/functions/starts_ends_with.d.ts +0 -3
- package/dist/dialect/trino/functions/starts_ends_with.js +0 -43
- package/dist/dialect/trino/functions/string_agg.d.ts +0 -3
- package/dist/dialect/trino/functions/string_agg.js +0 -55
- package/dist/dialect/trino/functions/trino_functions.d.ts +0 -1
- package/dist/dialect/trino/functions/trino_functions.js +0 -59
- package/dist/dialect/trino/functions/trunc.d.ts +0 -2
- package/dist/dialect/trino/functions/trunc.js +0 -39
|
@@ -1,42 +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.fnReplace = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnReplace() {
|
|
28
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.anyExprType)('string'));
|
|
29
|
-
const stringPattern = (0, util_1.makeParam)('pattern', (0, util_1.anyExprType)('string'));
|
|
30
|
-
const regexPattern = (0, util_1.makeParam)('pattern', (0, util_1.anyExprType)('regular expression'));
|
|
31
|
-
const replacement = (0, util_1.makeParam)('replacement', (0, util_1.anyExprType)('string'));
|
|
32
|
-
// TODO maybe we need to have a parameter to say whether it's a global replacement or not...
|
|
33
|
-
return [
|
|
34
|
-
(0, util_1.overload)((0, util_1.minScalar)('string'), [value.param, stringPattern.param, replacement.param], (0, util_1.sql) `REPLACE(${value.arg}, ${stringPattern.arg}, ${replacement.arg})`),
|
|
35
|
-
// TODO perhaps this should be a separate `regexp_replace` function.
|
|
36
|
-
// Which would better match BQ, but I think it should be just a different
|
|
37
|
-
// overload of `replace` (how it is here):
|
|
38
|
-
(0, util_1.overload)((0, util_1.minScalar)('string'), [value.param, regexPattern.param, replacement.param], (0, util_1.sql) `REGEXP_REPLACE(${value.arg}, ${regexPattern.arg}, ${replacement.arg})`),
|
|
39
|
-
];
|
|
40
|
-
}
|
|
41
|
-
exports.fnReplace = fnReplace;
|
|
42
|
-
//# sourceMappingURL=replace.js.map
|
|
@@ -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.fnReverse = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnReverse() {
|
|
28
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.anyExprType)('string'));
|
|
29
|
-
return [
|
|
30
|
-
(0, util_1.overload)((0, util_1.minScalar)('string'), [value.param], (0, util_1.sql) `REVERSE(${value.arg})`),
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
exports.fnReverse = fnReverse;
|
|
34
|
-
//# sourceMappingURL=reverse.js.map
|
|
@@ -1,40 +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.fnRound = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnRound() {
|
|
28
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.anyExprType)('number'));
|
|
29
|
-
// TODO this parameter should only accept integers, but we don't have a good
|
|
30
|
-
// way of expressing that constraint at the moment
|
|
31
|
-
const precision = (0, util_1.makeParam)('precision', (0, util_1.anyExprType)('number'));
|
|
32
|
-
return [
|
|
33
|
-
(0, util_1.overload)((0, util_1.minScalar)('number'), [value.param], (0, util_1.sql) `ROUND(${value.arg})`),
|
|
34
|
-
(0, util_1.overload)((0, util_1.minScalar)('number'), [value.param, precision.param], (0, util_1.sql) `ROUND(${value.arg}, ${precision.arg})`),
|
|
35
|
-
// TODO Consider adding a third overload for round(x, y, mode), where
|
|
36
|
-
// "mode" is "ROUND_HALF_AWAY_FROM_ZERO" or "ROUND_HALF_EVEN"
|
|
37
|
-
];
|
|
38
|
-
}
|
|
39
|
-
exports.fnRound = fnRound;
|
|
40
|
-
//# sourceMappingURL=round.js.map
|
|
@@ -1,40 +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.fnRowNumber = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
// TODO here we just assume that the OVER clause just goes right after the
|
|
28
|
-
// generated expression, which isn't necessarily true given the way these overloads
|
|
29
|
-
// work... Theoretically you could write sql`ROW_NUMBER() + 1` and then the OVER would
|
|
30
|
-
// be in the wrong place... It feels like there should be a fragment 'window function'
|
|
31
|
-
// to handle this in a better way...
|
|
32
|
-
function fnRowNumber() {
|
|
33
|
-
return [
|
|
34
|
-
(0, util_1.overload)((0, util_1.minAnalytic)('number'), [], (0, util_1.sql) `ROW_NUMBER()`, {
|
|
35
|
-
needsWindowOrderBy: true,
|
|
36
|
-
}),
|
|
37
|
-
];
|
|
38
|
-
}
|
|
39
|
-
exports.fnRowNumber = fnRowNumber;
|
|
40
|
-
//# sourceMappingURL=row_number.js.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DialectFunctionOverloadDef } from './util';
|
|
2
|
-
export declare function simple(fn: string): DialectFunctionOverloadDef[];
|
|
3
|
-
export declare const fnCos: () => DialectFunctionOverloadDef[];
|
|
4
|
-
export declare const fnAcos: () => DialectFunctionOverloadDef[];
|
|
5
|
-
export declare const fnSin: () => DialectFunctionOverloadDef[];
|
|
6
|
-
export declare const fnAsin: () => DialectFunctionOverloadDef[];
|
|
7
|
-
export declare const fnTan: () => DialectFunctionOverloadDef[];
|
|
8
|
-
export declare const fnAtan: () => DialectFunctionOverloadDef[];
|
|
9
|
-
export declare const fnSign: () => DialectFunctionOverloadDef[];
|
|
10
|
-
export declare const fnCeil: () => DialectFunctionOverloadDef[];
|
|
11
|
-
export declare const fnFloor: () => DialectFunctionOverloadDef[];
|
|
12
|
-
export declare const fnAbs: () => DialectFunctionOverloadDef[];
|
|
13
|
-
export declare const fnSqrt: () => DialectFunctionOverloadDef[];
|
|
14
|
-
export declare const fnLn: () => DialectFunctionOverloadDef[];
|
|
15
|
-
export declare const fnExp: () => DialectFunctionOverloadDef[];
|
|
@@ -1,60 +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.fnExp = exports.fnLn = exports.fnSqrt = exports.fnAbs = exports.fnFloor = exports.fnCeil = exports.fnSign = exports.fnAtan = exports.fnTan = exports.fnAsin = exports.fnSin = exports.fnAcos = exports.fnCos = exports.simple = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function simple(fn) {
|
|
28
|
-
return [
|
|
29
|
-
(0, util_1.overload)((0, util_1.minScalar)('number'), [(0, util_1.param)('value', (0, util_1.anyExprType)('number'))], (0, util_1.sql) `${fn}(${(0, util_1.arg)('value')})`),
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
exports.simple = simple;
|
|
33
|
-
// Trig functions
|
|
34
|
-
const fnCos = () => simple('COS');
|
|
35
|
-
exports.fnCos = fnCos;
|
|
36
|
-
const fnAcos = () => simple('ACOS');
|
|
37
|
-
exports.fnAcos = fnAcos;
|
|
38
|
-
const fnSin = () => simple('SIN');
|
|
39
|
-
exports.fnSin = fnSin;
|
|
40
|
-
const fnAsin = () => simple('ASIN');
|
|
41
|
-
exports.fnAsin = fnAsin;
|
|
42
|
-
const fnTan = () => simple('TAN');
|
|
43
|
-
exports.fnTan = fnTan;
|
|
44
|
-
const fnAtan = () => simple('ATAN');
|
|
45
|
-
exports.fnAtan = fnAtan;
|
|
46
|
-
const fnSign = () => simple('SIGN');
|
|
47
|
-
exports.fnSign = fnSign;
|
|
48
|
-
const fnCeil = () => simple('CEIL');
|
|
49
|
-
exports.fnCeil = fnCeil;
|
|
50
|
-
const fnFloor = () => simple('FLOOR');
|
|
51
|
-
exports.fnFloor = fnFloor;
|
|
52
|
-
const fnAbs = () => simple('ABS');
|
|
53
|
-
exports.fnAbs = fnAbs;
|
|
54
|
-
const fnSqrt = () => simple('SQRT');
|
|
55
|
-
exports.fnSqrt = fnSqrt;
|
|
56
|
-
const fnLn = () => simple('LN');
|
|
57
|
-
exports.fnLn = fnLn;
|
|
58
|
-
const fnExp = () => simple('EXP');
|
|
59
|
-
exports.fnExp = fnExp;
|
|
60
|
-
//# sourceMappingURL=simple_numeric_functions.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { DialectFunctionOverloadDef } from './util';
|
|
2
|
-
export declare function fnSqlNumber(): DialectFunctionOverloadDef[];
|
|
3
|
-
export declare function fnSqlString(): DialectFunctionOverloadDef[];
|
|
4
|
-
export declare function fnSqlDate(): DialectFunctionOverloadDef[];
|
|
5
|
-
export declare function fnSqlTimestamp(): DialectFunctionOverloadDef[];
|
|
6
|
-
export declare function fnSqlBoolean(): DialectFunctionOverloadDef[];
|
|
@@ -1,52 +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.fnSqlBoolean = exports.fnSqlTimestamp = exports.fnSqlDate = exports.fnSqlString = exports.fnSqlNumber = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnSqlNumber() {
|
|
28
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.literal)((0, util_1.maxScalar)('string')));
|
|
29
|
-
return [(0, util_1.overload)((0, util_1.minScalar)('number'), [value.param], value.arg)];
|
|
30
|
-
}
|
|
31
|
-
exports.fnSqlNumber = fnSqlNumber;
|
|
32
|
-
function fnSqlString() {
|
|
33
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.literal)((0, util_1.maxScalar)('string')));
|
|
34
|
-
return [(0, util_1.overload)((0, util_1.minScalar)('string'), [value.param], value.arg)];
|
|
35
|
-
}
|
|
36
|
-
exports.fnSqlString = fnSqlString;
|
|
37
|
-
function fnSqlDate() {
|
|
38
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.literal)((0, util_1.maxScalar)('string')));
|
|
39
|
-
return [(0, util_1.overload)((0, util_1.minScalar)('date'), [value.param], value.arg)];
|
|
40
|
-
}
|
|
41
|
-
exports.fnSqlDate = fnSqlDate;
|
|
42
|
-
function fnSqlTimestamp() {
|
|
43
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.literal)((0, util_1.maxScalar)('string')));
|
|
44
|
-
return [(0, util_1.overload)((0, util_1.minScalar)('timestamp'), [value.param], value.arg)];
|
|
45
|
-
}
|
|
46
|
-
exports.fnSqlTimestamp = fnSqlTimestamp;
|
|
47
|
-
function fnSqlBoolean() {
|
|
48
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.literal)((0, util_1.maxScalar)('string')));
|
|
49
|
-
return [(0, util_1.overload)((0, util_1.minScalar)('boolean'), [value.param], value.arg)];
|
|
50
|
-
}
|
|
51
|
-
exports.fnSqlBoolean = fnSqlBoolean;
|
|
52
|
-
//# sourceMappingURL=sql.js.map
|
|
@@ -1,43 +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.fnEndsWith = exports.fnStartsWith = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnStartsWith() {
|
|
28
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.anyExprType)('string'));
|
|
29
|
-
const prefix = (0, util_1.makeParam)('prefix', (0, util_1.anyExprType)('string'));
|
|
30
|
-
return [
|
|
31
|
-
(0, util_1.overload)((0, util_1.minScalar)('boolean'), [value.param, prefix.param], (0, util_1.sql) `COALESCE(STARTS_WITH(${value.arg}, ${prefix.arg}), false)`),
|
|
32
|
-
];
|
|
33
|
-
}
|
|
34
|
-
exports.fnStartsWith = fnStartsWith;
|
|
35
|
-
function fnEndsWith() {
|
|
36
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.anyExprType)('string'));
|
|
37
|
-
const suffix = (0, util_1.makeParam)('suffix', (0, util_1.anyExprType)('string'));
|
|
38
|
-
return [
|
|
39
|
-
(0, util_1.overload)((0, util_1.minScalar)('boolean'), [value.param, suffix.param], (0, util_1.sql) `COALESCE(ENDS_WITH(${value.arg}, ${suffix.arg}), false)`),
|
|
40
|
-
];
|
|
41
|
-
}
|
|
42
|
-
exports.fnEndsWith = fnEndsWith;
|
|
43
|
-
//# sourceMappingURL=starts_ends_with.js.map
|
|
@@ -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.fnStddev = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnStddev() {
|
|
28
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.maxScalar)('number'));
|
|
29
|
-
return [
|
|
30
|
-
(0, util_1.overload)((0, util_1.minAggregate)('number'), [value.param], (0, util_1.sql) `STDDEV(${value.arg})`),
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
exports.fnStddev = fnStddev;
|
|
34
|
-
//# sourceMappingURL=stddev.js.map
|
|
@@ -1,55 +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.fnStringAggDistinct = exports.fnStringAgg = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnStringAgg() {
|
|
28
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.maxScalar)('string'));
|
|
29
|
-
const separator = (0, util_1.makeParam)('separator', (0, util_1.literal)((0, util_1.maxScalar)('string')));
|
|
30
|
-
const orderBy = { node: 'aggregate_order_by' };
|
|
31
|
-
return [
|
|
32
|
-
(0, util_1.overload)((0, util_1.minAggregate)('string'), [value.param], (0, util_1.sql) `STRING_AGG(${value.arg}${orderBy})`, { supportsOrderBy: true, defaultOrderByArgIndex: 0 }),
|
|
33
|
-
(0, util_1.overload)((0, util_1.minAggregate)('string'), [value.param, separator.param], (0, util_1.sql) `STRING_AGG(${value.arg}, ${separator.arg}${orderBy})`, { supportsOrderBy: true, defaultOrderByArgIndex: 0 }),
|
|
34
|
-
];
|
|
35
|
-
}
|
|
36
|
-
exports.fnStringAgg = fnStringAgg;
|
|
37
|
-
function fnStringAggDistinct() {
|
|
38
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.maxScalar)('string'));
|
|
39
|
-
const separator = (0, util_1.makeParam)('separator', (0, util_1.literal)((0, util_1.maxScalar)('string')));
|
|
40
|
-
const orderBy = { node: 'aggregate_order_by' };
|
|
41
|
-
return [
|
|
42
|
-
(0, util_1.overload)((0, util_1.minAggregate)('string'), [value.param], (0, util_1.sql) `STRING_AGG(DISTINCT ${value.arg}${orderBy})`, {
|
|
43
|
-
isSymmetric: true,
|
|
44
|
-
supportsOrderBy: 'only_default',
|
|
45
|
-
defaultOrderByArgIndex: 0,
|
|
46
|
-
}),
|
|
47
|
-
(0, util_1.overload)((0, util_1.minAggregate)('string'), [value.param, separator.param], (0, util_1.sql) `STRING_AGG(DISTINCT ${value.arg}, ${separator.arg}${orderBy})`, {
|
|
48
|
-
isSymmetric: true,
|
|
49
|
-
supportsOrderBy: 'only_default',
|
|
50
|
-
defaultOrderByArgIndex: 0,
|
|
51
|
-
}),
|
|
52
|
-
];
|
|
53
|
-
}
|
|
54
|
-
exports.fnStringAggDistinct = fnStringAggDistinct;
|
|
55
|
-
//# sourceMappingURL=string_agg.js.map
|
|
@@ -1,35 +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.fnStrpos = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnStrpos() {
|
|
28
|
-
const testString = (0, util_1.makeParam)('test_string', (0, util_1.anyExprType)('string'));
|
|
29
|
-
const searchString = (0, util_1.makeParam)('search_string', (0, util_1.anyExprType)('string'));
|
|
30
|
-
return [
|
|
31
|
-
(0, util_1.overload)((0, util_1.minScalar)('number'), [testString.param, searchString.param], (0, util_1.sql) `STRPOS(${testString.arg}, ${searchString.arg})`),
|
|
32
|
-
];
|
|
33
|
-
}
|
|
34
|
-
exports.fnStrpos = fnStrpos;
|
|
35
|
-
//# sourceMappingURL=strpos.js.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.fnSubstr = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnSubstr() {
|
|
28
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.anyExprType)('string'));
|
|
29
|
-
const position = (0, util_1.makeParam)('position', (0, util_1.anyExprType)('number'));
|
|
30
|
-
const length = (0, util_1.makeParam)('length', (0, util_1.anyExprType)('number'));
|
|
31
|
-
return [
|
|
32
|
-
(0, util_1.overload)((0, util_1.minScalar)('string'), [value.param, position.param], (0, util_1.sql) `SUBSTR(${value.arg}, ${position.arg})`),
|
|
33
|
-
(0, util_1.overload)((0, util_1.minScalar)('string'), [value.param, position.param, length.param], (0, util_1.sql) `SUBSTR(${value.arg}, ${position.arg}, ${length.arg})`),
|
|
34
|
-
];
|
|
35
|
-
}
|
|
36
|
-
exports.fnSubstr = fnSubstr;
|
|
37
|
-
//# sourceMappingURL=substr.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DialectFunctionOverloadDef } from './util';
|
|
2
|
-
export declare function fnMinCumulative(): DialectFunctionOverloadDef[];
|
|
3
|
-
export declare function fnMaxCumulative(): DialectFunctionOverloadDef[];
|
|
4
|
-
export declare function fnSumCumulative(): DialectFunctionOverloadDef[];
|
|
5
|
-
export declare function fnMinWindow(): DialectFunctionOverloadDef[];
|
|
6
|
-
export declare function fnMaxWindow(): DialectFunctionOverloadDef[];
|
|
7
|
-
export declare function fnSumWindow(): DialectFunctionOverloadDef[];
|
|
@@ -1,94 +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.fnSumWindow = exports.fnMaxWindow = exports.fnMinWindow = exports.fnSumCumulative = exports.fnMaxCumulative = exports.fnMinCumulative = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
const types = ['string', 'number', 'timestamp', 'date'];
|
|
28
|
-
function fnMinCumulative() {
|
|
29
|
-
return types.flatMap(type => {
|
|
30
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.output)((0, util_1.maxAggregate)(type)));
|
|
31
|
-
return [
|
|
32
|
-
(0, util_1.overload)((0, util_1.minAnalytic)(type), [value.param], (0, util_1.sql) `MIN(${value.arg})`, {
|
|
33
|
-
needsWindowOrderBy: true,
|
|
34
|
-
}),
|
|
35
|
-
];
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
exports.fnMinCumulative = fnMinCumulative;
|
|
39
|
-
function fnMaxCumulative() {
|
|
40
|
-
return types.flatMap(type => {
|
|
41
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.output)((0, util_1.maxAggregate)(type)));
|
|
42
|
-
return [
|
|
43
|
-
(0, util_1.overload)((0, util_1.minAnalytic)(type), [value.param], (0, util_1.sql) `MAX(${value.arg})`, {
|
|
44
|
-
needsWindowOrderBy: true,
|
|
45
|
-
}),
|
|
46
|
-
];
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
exports.fnMaxCumulative = fnMaxCumulative;
|
|
50
|
-
function fnSumCumulative() {
|
|
51
|
-
return types.flatMap(type => {
|
|
52
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.output)((0, util_1.maxAggregate)(type)));
|
|
53
|
-
return [
|
|
54
|
-
(0, util_1.overload)((0, util_1.minAnalytic)(type), [value.param], (0, util_1.sql) `SUM(${value.arg})`, {
|
|
55
|
-
needsWindowOrderBy: true,
|
|
56
|
-
}),
|
|
57
|
-
];
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
exports.fnSumCumulative = fnSumCumulative;
|
|
61
|
-
function fnMinWindow() {
|
|
62
|
-
return types.flatMap(type => {
|
|
63
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.output)((0, util_1.maxAggregate)(type)));
|
|
64
|
-
return [
|
|
65
|
-
(0, util_1.overload)((0, util_1.minAnalytic)(type), [value.param], (0, util_1.sql) `MIN(${value.arg})`, {
|
|
66
|
-
needsWindowOrderBy: false,
|
|
67
|
-
}),
|
|
68
|
-
];
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
exports.fnMinWindow = fnMinWindow;
|
|
72
|
-
function fnMaxWindow() {
|
|
73
|
-
return types.flatMap(type => {
|
|
74
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.output)((0, util_1.maxAggregate)(type)));
|
|
75
|
-
return [
|
|
76
|
-
(0, util_1.overload)((0, util_1.minAnalytic)(type), [value.param], (0, util_1.sql) `MAX(${value.arg})`, {
|
|
77
|
-
needsWindowOrderBy: false,
|
|
78
|
-
}),
|
|
79
|
-
];
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
exports.fnMaxWindow = fnMaxWindow;
|
|
83
|
-
function fnSumWindow() {
|
|
84
|
-
return types.flatMap(type => {
|
|
85
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.output)((0, util_1.maxAggregate)(type)));
|
|
86
|
-
return [
|
|
87
|
-
(0, util_1.overload)((0, util_1.minAnalytic)(type), [value.param], (0, util_1.sql) `SUM(${value.arg})`, {
|
|
88
|
-
needsWindowOrderBy: false,
|
|
89
|
-
}),
|
|
90
|
-
];
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
exports.fnSumWindow = fnSumWindow;
|
|
94
|
-
//# sourceMappingURL=sum_min_max_window.js.map
|