@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,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.fnSumMoving = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnSumMoving() {
|
|
28
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.output)((0, util_1.maxAggregate)('number')));
|
|
29
|
-
const preceding = (0, util_1.makeParam)('preceding', (0, util_1.literal)((0, util_1.maxScalar)('number')));
|
|
30
|
-
const following = (0, util_1.makeParam)('following', (0, util_1.literal)((0, util_1.maxScalar)('number')));
|
|
31
|
-
return [
|
|
32
|
-
(0, util_1.overload)((0, util_1.minAnalytic)('number'), [value.param, preceding.param], (0, util_1.sql) `SUM(${value.arg})`, {
|
|
33
|
-
needsWindowOrderBy: true,
|
|
34
|
-
between: { preceding: 'preceding', following: 0 },
|
|
35
|
-
}),
|
|
36
|
-
(0, util_1.overload)((0, util_1.minAnalytic)('number'), [value.param, preceding.param, following.param], (0, util_1.sql) `SUM(${value.arg})`, {
|
|
37
|
-
needsWindowOrderBy: true,
|
|
38
|
-
between: { preceding: 'preceding', following: 'following' },
|
|
39
|
-
}),
|
|
40
|
-
];
|
|
41
|
-
}
|
|
42
|
-
exports.fnSumMoving = fnSumMoving;
|
|
43
|
-
//# sourceMappingURL=sum_moving.js.map
|
|
@@ -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.fnRtrim = exports.fnLtrim = exports.fnTrim = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function trimFn(fn) {
|
|
28
|
-
return [
|
|
29
|
-
(0, util_1.overload)((0, util_1.minScalar)('string'), [(0, util_1.param)('value', (0, util_1.anyExprType)('string'))], (0, util_1.sql) `${fn}(${(0, util_1.arg)('value')})`),
|
|
30
|
-
(0, util_1.overload)((0, util_1.minScalar)('string'), [
|
|
31
|
-
(0, util_1.param)('value', (0, util_1.anyExprType)('string')),
|
|
32
|
-
(0, util_1.param)('trim_characters', (0, util_1.anyExprType)('string')),
|
|
33
|
-
], (0, util_1.sql) `${fn}(${(0, util_1.arg)('value')},${(0, util_1.arg)('trim_characters')})`),
|
|
34
|
-
];
|
|
35
|
-
}
|
|
36
|
-
const fnTrim = () => trimFn('TRIM');
|
|
37
|
-
exports.fnTrim = fnTrim;
|
|
38
|
-
const fnLtrim = () => trimFn('LTRIM');
|
|
39
|
-
exports.fnLtrim = fnLtrim;
|
|
40
|
-
const fnRtrim = () => trimFn('RTRIM');
|
|
41
|
-
exports.fnRtrim = fnRtrim;
|
|
42
|
-
//# sourceMappingURL=trim_functions.js.map
|
|
@@ -1,38 +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.fnTrunc = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnTrunc() {
|
|
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) `TRUNC(${value.arg})`),
|
|
34
|
-
(0, util_1.overload)((0, util_1.minScalar)('number'), [value.param, precision.param], (0, util_1.sql) `TRUNC(${value.arg}, ${precision.arg})`),
|
|
35
|
-
];
|
|
36
|
-
}
|
|
37
|
-
exports.fnTrunc = fnTrunc;
|
|
38
|
-
//# sourceMappingURL=trunc.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.fnUpper = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnUpper() {
|
|
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) `UPPER(${value.arg})`),
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
exports.fnUpper = fnUpper;
|
|
34
|
-
//# sourceMappingURL=upper.js.map
|
|
@@ -1,33 +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.fnByteLength = void 0;
|
|
26
|
-
const util_1 = require("../../functions/util");
|
|
27
|
-
function fnByteLength() {
|
|
28
|
-
return [
|
|
29
|
-
(0, util_1.overload)((0, util_1.minScalar)('number'), [(0, util_1.param)('value', (0, util_1.anyExprType)('string'))], (0, util_1.sql) `OCTET_LENGTH(${(0, util_1.arg)('value')})`),
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
exports.fnByteLength = fnByteLength;
|
|
33
|
-
//# sourceMappingURL=byte_length.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.POSTGRES_DIALECT_FUNCTIONS = void 0;
|
|
10
|
-
exports.POSTGRES_DIALECT_FUNCTIONS = {};
|
|
11
|
-
//# sourceMappingURL=dialect_functions.js.map
|
|
@@ -1,38 +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 = void 0;
|
|
26
|
-
const util_1 = require("../../functions/util");
|
|
27
|
-
function fnEndsWith() {
|
|
28
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.anyExprType)('string'));
|
|
29
|
-
const suffix = (0, util_1.makeParam)('suffix', (0, util_1.anyExprType)('string'));
|
|
30
|
-
return [
|
|
31
|
-
(0, util_1.overload)((0, util_1.minScalar)('boolean'), [value.param, suffix.param],
|
|
32
|
-
// There's no ENDS_WITH function in Postgres, so we do a hacky check that the last
|
|
33
|
-
// N characters, where N is the length of the suffix, are equal to the suffix.
|
|
34
|
-
(0, util_1.sql) `COALESCE(RIGHT(${value.arg}, LENGTH(${suffix.arg})) = ${suffix.arg}, false)`),
|
|
35
|
-
];
|
|
36
|
-
}
|
|
37
|
-
exports.fnEndsWith = fnEndsWith;
|
|
38
|
-
//# sourceMappingURL=ends_with.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.fnLeast = exports.fnGreatest = void 0;
|
|
26
|
-
const util_1 = require("../../functions/util");
|
|
27
|
-
const types = [
|
|
28
|
-
'string',
|
|
29
|
-
'number',
|
|
30
|
-
'timestamp',
|
|
31
|
-
'date',
|
|
32
|
-
'json',
|
|
33
|
-
];
|
|
34
|
-
function greatestOrLeast(fn) {
|
|
35
|
-
return types.map(type => (0, util_1.overload)((0, util_1.minScalar)(type), [(0, util_1.params)('values', (0, util_1.anyExprType)(type))],
|
|
36
|
-
// We match BigQuery null behavior here -- if any argument is null, return null
|
|
37
|
-
(0, util_1.sql) `CASE WHEN NUM_NULLS(${(0, util_1.spread)((0, util_1.arg)('values'))}) > 0 THEN NULL ELSE ${fn}(${(0, util_1.spread)((0, util_1.arg)('values'))}) END`));
|
|
38
|
-
}
|
|
39
|
-
const fnGreatest = () => greatestOrLeast('GREATEST');
|
|
40
|
-
exports.fnGreatest = fnGreatest;
|
|
41
|
-
const fnLeast = () => greatestOrLeast('LEAST');
|
|
42
|
-
exports.fnLeast = fnLeast;
|
|
43
|
-
//# sourceMappingURL=greatest_and_least.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.fnIfnull = void 0;
|
|
26
|
-
const util_1 = require("../../functions/util");
|
|
27
|
-
const types = [
|
|
28
|
-
'string',
|
|
29
|
-
'number',
|
|
30
|
-
'timestamp',
|
|
31
|
-
'date',
|
|
32
|
-
'json',
|
|
33
|
-
];
|
|
34
|
-
function fnIfnull() {
|
|
35
|
-
return types.map(type => (0, util_1.overload)((0, util_1.minScalar)(type), [(0, util_1.param)('value', (0, util_1.anyExprType)(type)), (0, util_1.param)('default', (0, util_1.anyExprType)(type))],
|
|
36
|
-
// Postgres doesn't have an IFNULL function, so we use COALESCE, which is equivalent.
|
|
37
|
-
(0, util_1.sql) `COALESCE(${(0, util_1.arg)('value')}, ${(0, util_1.arg)('default')})`));
|
|
38
|
-
}
|
|
39
|
-
exports.fnIfnull = fnIfnull;
|
|
40
|
-
//# sourceMappingURL=ifnull.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { POSTGRES_FUNCTIONS } from './postgres_functions';
|
|
@@ -1,28 +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.POSTGRES_FUNCTIONS = void 0;
|
|
26
|
-
var postgres_functions_1 = require("./postgres_functions");
|
|
27
|
-
Object.defineProperty(exports, "POSTGRES_FUNCTIONS", { enumerable: true, get: function () { return postgres_functions_1.POSTGRES_FUNCTIONS; } });
|
|
28
|
-
//# sourceMappingURL=index.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.fnIsInf = void 0;
|
|
26
|
-
const util_1 = require("../../functions/util");
|
|
27
|
-
function fnIsInf() {
|
|
28
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.anyExprType)('number'));
|
|
29
|
-
return [
|
|
30
|
-
(0, util_1.overload)((0, util_1.minScalar)('boolean'), [value.param], (0, util_1.sql) `COALESCE(${value.arg} = DOUBLE PRECISION 'Infinity' OR ${value.arg} = DOUBLE PRECISION '-Infinity', false)`),
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
exports.fnIsInf = fnIsInf;
|
|
34
|
-
//# sourceMappingURL=is_inf.js.map
|
|
@@ -1,33 +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.fnIsNan = void 0;
|
|
26
|
-
const util_1 = require("../../functions/util");
|
|
27
|
-
function fnIsNan() {
|
|
28
|
-
return [
|
|
29
|
-
(0, util_1.overload)((0, util_1.minScalar)('boolean'), [(0, util_1.param)('value', (0, util_1.anyExprType)('number'))], (0, util_1.sql) `COALESCE(${(0, util_1.arg)('value')} = NUMERIC 'NaN', false)`),
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
exports.fnIsNan = fnIsNan;
|
|
33
|
-
//# sourceMappingURL=is_nan.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.fnLog = void 0;
|
|
26
|
-
const util_1 = require("../../functions/util");
|
|
27
|
-
function fnLog() {
|
|
28
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.anyExprType)('number'));
|
|
29
|
-
const base = (0, util_1.makeParam)('base', (0, util_1.anyExprType)('number'));
|
|
30
|
-
return [
|
|
31
|
-
(0, util_1.overload)((0, util_1.minScalar)('number'), [value.param, base.param],
|
|
32
|
-
// Parameter order is backwards in Postgres.
|
|
33
|
-
(0, util_1.sql) `LOG(${base.arg}, ${value.arg})`),
|
|
34
|
-
];
|
|
35
|
-
}
|
|
36
|
-
exports.fnLog = fnLog;
|
|
37
|
-
//# sourceMappingURL=log.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const POSTGRES_FUNCTIONS: import("../../functions/function_map").FunctionMap;
|
|
@@ -1,63 +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.POSTGRES_FUNCTIONS = void 0;
|
|
26
|
-
const functions_1 = require("../../functions");
|
|
27
|
-
const string_agg_1 = require("./string_agg");
|
|
28
|
-
const byte_length_1 = require("./byte_length");
|
|
29
|
-
const ends_with_1 = require("./ends_with");
|
|
30
|
-
const greatest_and_least_1 = require("./greatest_and_least");
|
|
31
|
-
const ifnull_1 = require("./ifnull");
|
|
32
|
-
const is_inf_1 = require("./is_inf");
|
|
33
|
-
const is_nan_1 = require("./is_nan");
|
|
34
|
-
const log_1 = require("./log");
|
|
35
|
-
const rand_1 = require("./rand");
|
|
36
|
-
const regexp_extract_1 = require("./regexp_extract");
|
|
37
|
-
const replace_1 = require("./replace");
|
|
38
|
-
const round_1 = require("./round");
|
|
39
|
-
const stddev_1 = require("./stddev");
|
|
40
|
-
const substr_1 = require("./substr");
|
|
41
|
-
const trunc_1 = require("./trunc");
|
|
42
|
-
const unicode_1 = require("./unicode");
|
|
43
|
-
exports.POSTGRES_FUNCTIONS = functions_1.FUNCTIONS.clone();
|
|
44
|
-
exports.POSTGRES_FUNCTIONS.add('regexp_extract', regexp_extract_1.fnRegexpExtract);
|
|
45
|
-
exports.POSTGRES_FUNCTIONS.add('stddev', stddev_1.fnStddev);
|
|
46
|
-
exports.POSTGRES_FUNCTIONS.add('rand', rand_1.fnRand);
|
|
47
|
-
exports.POSTGRES_FUNCTIONS.add('greatest', greatest_and_least_1.fnGreatest);
|
|
48
|
-
exports.POSTGRES_FUNCTIONS.add('least', greatest_and_least_1.fnLeast);
|
|
49
|
-
exports.POSTGRES_FUNCTIONS.add('is_nan', is_nan_1.fnIsNan);
|
|
50
|
-
exports.POSTGRES_FUNCTIONS.add('is_inf', is_inf_1.fnIsInf);
|
|
51
|
-
exports.POSTGRES_FUNCTIONS.add('round', round_1.fnRound);
|
|
52
|
-
exports.POSTGRES_FUNCTIONS.add('byte_length', byte_length_1.fnByteLength);
|
|
53
|
-
exports.POSTGRES_FUNCTIONS.add('unicode', unicode_1.fnUnicode);
|
|
54
|
-
exports.POSTGRES_FUNCTIONS.add('ifnull', ifnull_1.fnIfnull);
|
|
55
|
-
exports.POSTGRES_FUNCTIONS.add('trunc', trunc_1.fnTrunc);
|
|
56
|
-
exports.POSTGRES_FUNCTIONS.add('substr', substr_1.fnSubstr);
|
|
57
|
-
exports.POSTGRES_FUNCTIONS.add('replace', replace_1.fnReplace);
|
|
58
|
-
exports.POSTGRES_FUNCTIONS.add('ends_with', ends_with_1.fnEndsWith);
|
|
59
|
-
exports.POSTGRES_FUNCTIONS.add('string_agg', string_agg_1.fnStringAgg);
|
|
60
|
-
exports.POSTGRES_FUNCTIONS.add('string_agg_distinct', string_agg_1.fnStringAggDistinct);
|
|
61
|
-
exports.POSTGRES_FUNCTIONS.add('log', log_1.fnLog);
|
|
62
|
-
exports.POSTGRES_FUNCTIONS.seal();
|
|
63
|
-
//# sourceMappingURL=postgres_functions.js.map
|
|
@@ -1,31 +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.fnRand = void 0;
|
|
26
|
-
const util_1 = require("../../functions/util");
|
|
27
|
-
function fnRand() {
|
|
28
|
-
return [(0, util_1.overload)((0, util_1.minScalar)('number'), [], (0, util_1.sql) `RANDOM()`)];
|
|
29
|
-
}
|
|
30
|
-
exports.fnRand = fnRand;
|
|
31
|
-
//# sourceMappingURL=rand.js.map
|