@polyglot-sql/sdk 0.5.2 → 0.5.4
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/README.md +62 -14
- package/dist/cdn/polyglot.esm.js +1775 -1702
- package/dist/index.cjs +146 -27
- package/dist/index.d.cts +38 -1
- package/dist/index.d.ts +38 -1
- package/dist/index.js +163 -27
- package/dist/index.node.js +143 -27
- package/dist/manual.js +157 -25
- package/dist/polyglot_sql.wasm +0 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1699,6 +1699,24 @@ function ast_get_table_names$1(ast_json) {
|
|
|
1699
1699
|
wasm$3.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
1702
|
+
function ast_get_tables$1(ast_json) {
|
|
1703
|
+
let deferred2_0;
|
|
1704
|
+
let deferred2_1;
|
|
1705
|
+
try {
|
|
1706
|
+
const retptr = wasm$3.__wbindgen_add_to_stack_pointer(-16);
|
|
1707
|
+
const ptr0 = passStringToWasm0(ast_json, wasm$3.__wbindgen_export, wasm$3.__wbindgen_export2);
|
|
1708
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1709
|
+
wasm$3.ast_get_tables(retptr, ptr0, len0);
|
|
1710
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1711
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1712
|
+
deferred2_0 = r0;
|
|
1713
|
+
deferred2_1 = r1;
|
|
1714
|
+
return getStringFromWasm0(r0, r1);
|
|
1715
|
+
} finally {
|
|
1716
|
+
wasm$3.__wbindgen_add_to_stack_pointer(16);
|
|
1717
|
+
wasm$3.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1702
1720
|
function ast_get_window_functions$1(ast_json) {
|
|
1703
1721
|
let deferred2_0;
|
|
1704
1722
|
let deferred2_1;
|
|
@@ -1891,6 +1909,44 @@ function ast_set_limit$1(ast_json, limit) {
|
|
|
1891
1909
|
wasm$3.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
1892
1910
|
}
|
|
1893
1911
|
}
|
|
1912
|
+
function ast_set_offset$1(ast_json, offset) {
|
|
1913
|
+
let deferred2_0;
|
|
1914
|
+
let deferred2_1;
|
|
1915
|
+
try {
|
|
1916
|
+
const retptr = wasm$3.__wbindgen_add_to_stack_pointer(-16);
|
|
1917
|
+
const ptr0 = passStringToWasm0(ast_json, wasm$3.__wbindgen_export, wasm$3.__wbindgen_export2);
|
|
1918
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1919
|
+
wasm$3.ast_set_offset(retptr, ptr0, len0, offset);
|
|
1920
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1921
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1922
|
+
deferred2_0 = r0;
|
|
1923
|
+
deferred2_1 = r1;
|
|
1924
|
+
return getStringFromWasm0(r0, r1);
|
|
1925
|
+
} finally {
|
|
1926
|
+
wasm$3.__wbindgen_add_to_stack_pointer(16);
|
|
1927
|
+
wasm$3.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
function ast_set_order_by$1(ast_json, order_by_json) {
|
|
1931
|
+
let deferred3_0;
|
|
1932
|
+
let deferred3_1;
|
|
1933
|
+
try {
|
|
1934
|
+
const retptr = wasm$3.__wbindgen_add_to_stack_pointer(-16);
|
|
1935
|
+
const ptr0 = passStringToWasm0(ast_json, wasm$3.__wbindgen_export, wasm$3.__wbindgen_export2);
|
|
1936
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1937
|
+
const ptr1 = passStringToWasm0(order_by_json, wasm$3.__wbindgen_export, wasm$3.__wbindgen_export2);
|
|
1938
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1939
|
+
wasm$3.ast_set_order_by(retptr, ptr0, len0, ptr1, len1);
|
|
1940
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1941
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1942
|
+
deferred3_0 = r0;
|
|
1943
|
+
deferred3_1 = r1;
|
|
1944
|
+
return getStringFromWasm0(r0, r1);
|
|
1945
|
+
} finally {
|
|
1946
|
+
wasm$3.__wbindgen_add_to_stack_pointer(16);
|
|
1947
|
+
wasm$3.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1894
1950
|
function diff_sql$1(source_sql, target_sql, dialect, delta_only, f, t) {
|
|
1895
1951
|
let deferred4_0;
|
|
1896
1952
|
let deferred4_1;
|
|
@@ -2623,10 +2679,6 @@ function __wbg_call_389efe28435a9388() {
|
|
|
2623
2679
|
return addHeapObject(ret);
|
|
2624
2680
|
}, arguments);
|
|
2625
2681
|
}
|
|
2626
|
-
function __wbg_codePointAt_bf59dbf74d8db275(arg0, arg1) {
|
|
2627
|
-
const ret = getObject(arg0).codePointAt(arg1 >>> 0);
|
|
2628
|
-
return addHeapObject(ret);
|
|
2629
|
-
}
|
|
2630
2682
|
function __wbg_done_57b39ecd9addfe81(arg0) {
|
|
2631
2683
|
const ret = getObject(arg0).done;
|
|
2632
2684
|
return ret;
|
|
@@ -2716,10 +2768,6 @@ function __wbg_length_35a7bace40f36eac(arg0) {
|
|
|
2716
2768
|
const ret = getObject(arg0).length;
|
|
2717
2769
|
return ret;
|
|
2718
2770
|
}
|
|
2719
|
-
function __wbg_length_68dc7c5cf1b6d349(arg0) {
|
|
2720
|
-
const ret = getObject(arg0).length;
|
|
2721
|
-
return ret;
|
|
2722
|
-
}
|
|
2723
2771
|
function __wbg_new_361308b2356cecd0() {
|
|
2724
2772
|
const ret = new Object();
|
|
2725
2773
|
return addHeapObject(ret);
|
|
@@ -3048,9 +3096,7 @@ const __vite__wasmImports = { "./polyglot_sql_wasm_bg.js": {
|
|
|
3048
3096
|
"__wbg_call_389efe28435a9388": __wbg_call_389efe28435a9388,
|
|
3049
3097
|
"__wbg_next_418f80d8f5303233": __wbg_next_418f80d8f5303233,
|
|
3050
3098
|
"__wbg_next_3482f54c49e8af19": __wbg_next_3482f54c49e8af19,
|
|
3051
|
-
"__wbg_codePointAt_bf59dbf74d8db275": __wbg_codePointAt_bf59dbf74d8db275,
|
|
3052
3099
|
"__wbg_fromCodePoint_22365db7b7d6ac39": __wbg_fromCodePoint_22365db7b7d6ac39,
|
|
3053
|
-
"__wbg_length_68dc7c5cf1b6d349": __wbg_length_68dc7c5cf1b6d349,
|
|
3054
3100
|
"__wbg___wbindgen_in_47fa6863be6f2f25": __wbg___wbindgen_in_47fa6863be6f2f25,
|
|
3055
3101
|
"__wbg___wbindgen_throw_be289d5034ed271b": __wbg___wbindgen_throw_be289d5034ed271b,
|
|
3056
3102
|
"__wbg___wbindgen_is_null_ac34f5003991759a": __wbg___wbindgen_is_null_ac34f5003991759a,
|
|
@@ -3105,6 +3151,7 @@ async function __polyglot_init_wasm() {
|
|
|
3105
3151
|
ast_get_literals = __vite__wasmModule.ast_get_literals;
|
|
3106
3152
|
ast_get_subqueries = __vite__wasmModule.ast_get_subqueries;
|
|
3107
3153
|
ast_get_table_names = __vite__wasmModule.ast_get_table_names;
|
|
3154
|
+
ast_get_tables = __vite__wasmModule.ast_get_tables;
|
|
3108
3155
|
ast_get_window_functions = __vite__wasmModule.ast_get_window_functions;
|
|
3109
3156
|
ast_node_count = __vite__wasmModule.ast_node_count;
|
|
3110
3157
|
ast_qualify_columns = __vite__wasmModule.ast_qualify_columns;
|
|
@@ -3115,6 +3162,8 @@ async function __polyglot_init_wasm() {
|
|
|
3115
3162
|
ast_rename_tables_with_options = __vite__wasmModule.ast_rename_tables_with_options;
|
|
3116
3163
|
ast_set_distinct = __vite__wasmModule.ast_set_distinct;
|
|
3117
3164
|
ast_set_limit = __vite__wasmModule.ast_set_limit;
|
|
3165
|
+
ast_set_offset = __vite__wasmModule.ast_set_offset;
|
|
3166
|
+
ast_set_order_by = __vite__wasmModule.ast_set_order_by;
|
|
3118
3167
|
diff_sql = __vite__wasmModule.diff_sql;
|
|
3119
3168
|
format_sql = __vite__wasmModule.format_sql;
|
|
3120
3169
|
format_sql_value = __vite__wasmModule.format_sql_value;
|
|
@@ -3304,6 +3353,7 @@ let ast_get_functions;
|
|
|
3304
3353
|
let ast_get_literals;
|
|
3305
3354
|
let ast_get_subqueries;
|
|
3306
3355
|
let ast_get_table_names;
|
|
3356
|
+
let ast_get_tables;
|
|
3307
3357
|
let ast_get_window_functions;
|
|
3308
3358
|
let ast_node_count;
|
|
3309
3359
|
let ast_qualify_columns;
|
|
@@ -3314,6 +3364,8 @@ let ast_rename_tables;
|
|
|
3314
3364
|
let ast_rename_tables_with_options;
|
|
3315
3365
|
let ast_set_distinct;
|
|
3316
3366
|
let ast_set_limit;
|
|
3367
|
+
let ast_set_offset;
|
|
3368
|
+
let ast_set_order_by;
|
|
3317
3369
|
let diff_sql;
|
|
3318
3370
|
let format_sql;
|
|
3319
3371
|
let format_sql_value;
|
|
@@ -3505,6 +3557,7 @@ const wasm$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
3505
3557
|
ast_get_literals,
|
|
3506
3558
|
ast_get_subqueries,
|
|
3507
3559
|
ast_get_table_names,
|
|
3560
|
+
ast_get_tables,
|
|
3508
3561
|
ast_get_window_functions,
|
|
3509
3562
|
ast_node_count,
|
|
3510
3563
|
ast_qualify_columns,
|
|
@@ -3515,6 +3568,8 @@ const wasm$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
3515
3568
|
ast_rename_tables_with_options,
|
|
3516
3569
|
ast_set_distinct,
|
|
3517
3570
|
ast_set_limit,
|
|
3571
|
+
ast_set_offset,
|
|
3572
|
+
ast_set_order_by,
|
|
3518
3573
|
diff_sql,
|
|
3519
3574
|
format_sql,
|
|
3520
3575
|
format_sql_value,
|
|
@@ -3698,6 +3753,7 @@ const wasmModule = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
3698
3753
|
ast_get_literals: ast_get_literals$1,
|
|
3699
3754
|
ast_get_subqueries: ast_get_subqueries$1,
|
|
3700
3755
|
ast_get_table_names: ast_get_table_names$1,
|
|
3756
|
+
ast_get_tables: ast_get_tables$1,
|
|
3701
3757
|
ast_get_window_functions: ast_get_window_functions$1,
|
|
3702
3758
|
ast_node_count: ast_node_count$1,
|
|
3703
3759
|
ast_qualify_columns: ast_qualify_columns$1,
|
|
@@ -3708,6 +3764,8 @@ const wasmModule = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
3708
3764
|
ast_rename_tables_with_options: ast_rename_tables_with_options$1,
|
|
3709
3765
|
ast_set_distinct: ast_set_distinct$1,
|
|
3710
3766
|
ast_set_limit: ast_set_limit$1,
|
|
3767
|
+
ast_set_offset: ast_set_offset$1,
|
|
3768
|
+
ast_set_order_by: ast_set_order_by$1,
|
|
3711
3769
|
diff_sql: diff_sql$1,
|
|
3712
3770
|
format_sql: format_sql$1,
|
|
3713
3771
|
format_sql_value: format_sql_value$1,
|
|
@@ -3891,6 +3949,69 @@ function parseAstResult(json) {
|
|
|
3891
3949
|
const result = JSON.parse(json);
|
|
3892
3950
|
return result.success ? JSON.parse(result.ast) : null;
|
|
3893
3951
|
}
|
|
3952
|
+
function isQueryWithOuterClauses(node) {
|
|
3953
|
+
return ["select", "union", "intersect", "except"].includes(getExprType(node));
|
|
3954
|
+
}
|
|
3955
|
+
function applyLimitExpr(node, limit) {
|
|
3956
|
+
const type = getExprType(node);
|
|
3957
|
+
if (!isQueryWithOuterClauses(node)) {
|
|
3958
|
+
return node;
|
|
3959
|
+
}
|
|
3960
|
+
const data = getExprData(node);
|
|
3961
|
+
if (type === "select") {
|
|
3962
|
+
return makeExpr("select", {
|
|
3963
|
+
...data,
|
|
3964
|
+
limit: { this: limit, percent: false, comments: [] }
|
|
3965
|
+
});
|
|
3966
|
+
}
|
|
3967
|
+
return makeExpr(type, {
|
|
3968
|
+
...data,
|
|
3969
|
+
limit
|
|
3970
|
+
});
|
|
3971
|
+
}
|
|
3972
|
+
function applyOffsetExpr(node, offset) {
|
|
3973
|
+
const type = getExprType(node);
|
|
3974
|
+
if (!isQueryWithOuterClauses(node)) {
|
|
3975
|
+
return node;
|
|
3976
|
+
}
|
|
3977
|
+
const data = getExprData(node);
|
|
3978
|
+
if (type === "select") {
|
|
3979
|
+
return makeExpr("select", {
|
|
3980
|
+
...data,
|
|
3981
|
+
offset: { this: offset, rows: null }
|
|
3982
|
+
});
|
|
3983
|
+
}
|
|
3984
|
+
return makeExpr(type, {
|
|
3985
|
+
...data,
|
|
3986
|
+
offset
|
|
3987
|
+
});
|
|
3988
|
+
}
|
|
3989
|
+
function applyOrderBy(node, orderBy) {
|
|
3990
|
+
const type = getExprType(node);
|
|
3991
|
+
if (!isQueryWithOuterClauses(node)) {
|
|
3992
|
+
return node;
|
|
3993
|
+
}
|
|
3994
|
+
const expressions = orderBy.map((expression) => {
|
|
3995
|
+
if (getExprType(expression) === "ordered") {
|
|
3996
|
+
return getExprData(expression);
|
|
3997
|
+
}
|
|
3998
|
+
return {
|
|
3999
|
+
this: expression,
|
|
4000
|
+
desc: false,
|
|
4001
|
+
nulls_first: null,
|
|
4002
|
+
explicit_asc: false,
|
|
4003
|
+
with_fill: null
|
|
4004
|
+
};
|
|
4005
|
+
});
|
|
4006
|
+
return makeExpr(type, {
|
|
4007
|
+
...getExprData(node),
|
|
4008
|
+
order_by: {
|
|
4009
|
+
expressions,
|
|
4010
|
+
siblings: false,
|
|
4011
|
+
comments: []
|
|
4012
|
+
}
|
|
4013
|
+
});
|
|
4014
|
+
}
|
|
3894
4015
|
function transformValue(value, config, parent) {
|
|
3895
4016
|
if (value === null || value === void 0) return value;
|
|
3896
4017
|
if (Array.isArray(value)) {
|
|
@@ -4060,25 +4181,21 @@ function setLimit(node, limit) {
|
|
|
4060
4181
|
const result = parseAstResult(ast_set_limit$1(exprToJson$1(node), limit));
|
|
4061
4182
|
return result ?? node;
|
|
4062
4183
|
}
|
|
4063
|
-
|
|
4064
|
-
return node;
|
|
4065
|
-
}
|
|
4066
|
-
const selectData = getExprData(node);
|
|
4067
|
-
return makeExpr("select", {
|
|
4068
|
-
...selectData,
|
|
4069
|
-
limit: { this: limit }
|
|
4070
|
-
});
|
|
4184
|
+
return applyLimitExpr(node, limit);
|
|
4071
4185
|
}
|
|
4072
4186
|
function setOffset(node, offset) {
|
|
4073
|
-
if (
|
|
4074
|
-
|
|
4187
|
+
if (typeof offset === "number") {
|
|
4188
|
+
const result = parseAstResult(ast_set_offset$1(exprToJson$1(node), offset));
|
|
4189
|
+
return result ?? node;
|
|
4075
4190
|
}
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4191
|
+
return applyOffsetExpr(node, offset);
|
|
4192
|
+
}
|
|
4193
|
+
function setOrderBy(node, orderBy) {
|
|
4194
|
+
const orderByExpressions = Array.isArray(orderBy) ? orderBy : [orderBy];
|
|
4195
|
+
const result = parseAstResult(
|
|
4196
|
+
ast_set_order_by$1(exprToJson$1(node), JSON.stringify(orderByExpressions))
|
|
4197
|
+
);
|
|
4198
|
+
return result ?? applyOrderBy(node, orderByExpressions);
|
|
4082
4199
|
}
|
|
4083
4200
|
function removeLimitOffset(node) {
|
|
4084
4201
|
if (getExprType(node) !== "select") {
|
|
@@ -4245,7 +4362,8 @@ function getColumns(node) {
|
|
|
4245
4362
|
return findByType(node, "column");
|
|
4246
4363
|
}
|
|
4247
4364
|
function getTables(node) {
|
|
4248
|
-
|
|
4365
|
+
const result = JSON.parse(ast_get_tables$1(exprToJson(node)));
|
|
4366
|
+
return result.success ? JSON.parse(result.ast) : [];
|
|
4249
4367
|
}
|
|
4250
4368
|
function getIdentifiers(node) {
|
|
4251
4369
|
return findByType(node, "identifier");
|
|
@@ -4478,6 +4596,7 @@ const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
4478
4596
|
setDistinct,
|
|
4479
4597
|
setLimit,
|
|
4480
4598
|
setOffset,
|
|
4599
|
+
setOrderBy,
|
|
4481
4600
|
some,
|
|
4482
4601
|
transform,
|
|
4483
4602
|
walk
|
package/dist/index.d.cts
CHANGED
|
@@ -1065,6 +1065,7 @@ export declare namespace ast {
|
|
|
1065
1065
|
setDistinct,
|
|
1066
1066
|
setLimit,
|
|
1067
1067
|
setOffset,
|
|
1068
|
+
setOrderBy,
|
|
1068
1069
|
transform,
|
|
1069
1070
|
NodePath,
|
|
1070
1071
|
NodePredicate,
|
|
@@ -2910,6 +2911,13 @@ declare type Cte = {
|
|
|
2910
2911
|
comments?: Array<string>;
|
|
2911
2912
|
};
|
|
2912
2913
|
|
|
2914
|
+
export declare interface CteFact {
|
|
2915
|
+
name: string;
|
|
2916
|
+
columns: string[];
|
|
2917
|
+
bodySql: string;
|
|
2918
|
+
outputColumns: string[];
|
|
2919
|
+
}
|
|
2920
|
+
|
|
2913
2921
|
/**
|
|
2914
2922
|
* Cube
|
|
2915
2923
|
*/
|
|
@@ -10870,11 +10878,15 @@ export declare interface ProjectionFact {
|
|
|
10870
10878
|
isStar: boolean;
|
|
10871
10879
|
starTable?: string;
|
|
10872
10880
|
transformKind: TransformKind;
|
|
10881
|
+
transformFunction?: TransformFunctionFact;
|
|
10873
10882
|
castType?: string;
|
|
10874
10883
|
typeHint?: string;
|
|
10884
|
+
nullability: ProjectionNullability;
|
|
10875
10885
|
upstream: ColumnReferenceFact[];
|
|
10876
10886
|
}
|
|
10877
10887
|
|
|
10888
|
+
export declare type ProjectionNullability = 'non_null' | 'nullable' | 'unknown';
|
|
10889
|
+
|
|
10878
10890
|
/**
|
|
10879
10891
|
* Properties
|
|
10880
10892
|
*/
|
|
@@ -11006,9 +11018,11 @@ declare type Quantile = {
|
|
|
11006
11018
|
export declare interface QueryAnalysis {
|
|
11007
11019
|
shape: QueryShape;
|
|
11008
11020
|
ctes: string[];
|
|
11021
|
+
cteFacts: CteFact[];
|
|
11009
11022
|
projections: ProjectionFact[];
|
|
11010
11023
|
relations: RelationFact[];
|
|
11011
11024
|
baseTables: RelationFact[];
|
|
11025
|
+
starProjections: StarProjectionFact[];
|
|
11012
11026
|
setOperations: SetOperationFact[];
|
|
11013
11027
|
}
|
|
11014
11028
|
|
|
@@ -11410,9 +11424,12 @@ declare type RegrValy = {
|
|
|
11410
11424
|
|
|
11411
11425
|
export declare interface RelationFact {
|
|
11412
11426
|
name: string;
|
|
11413
|
-
alias?: string;
|
|
11427
|
+
alias?: string | null;
|
|
11414
11428
|
kind: QueryAnalysisSourceKind;
|
|
11415
11429
|
columns: string[];
|
|
11430
|
+
catalog?: string | null;
|
|
11431
|
+
schema?: string | null;
|
|
11432
|
+
table?: string | null;
|
|
11416
11433
|
}
|
|
11417
11434
|
|
|
11418
11435
|
/**
|
|
@@ -12305,6 +12322,14 @@ export declare interface SetOperationFact {
|
|
|
12305
12322
|
|
|
12306
12323
|
export declare type SetOperationType = 'union' | 'union_all' | 'intersect' | 'except';
|
|
12307
12324
|
|
|
12325
|
+
/**
|
|
12326
|
+
* Set or update the ORDER BY clause.
|
|
12327
|
+
*
|
|
12328
|
+
* Bare expressions are normalized to ascending order entries. Existing
|
|
12329
|
+
* `ordered` expression nodes preserve their direction and null ordering.
|
|
12330
|
+
*/
|
|
12331
|
+
declare function setOrderBy(node: Expression, orderBy: Expression | Expression[]): Expression;
|
|
12332
|
+
|
|
12308
12333
|
/**
|
|
12309
12334
|
* SetProperty
|
|
12310
12335
|
*/
|
|
@@ -12654,6 +12679,12 @@ declare type Star = {
|
|
|
12654
12679
|
/** Create a star (*) expression. */
|
|
12655
12680
|
export declare function star(): Expr;
|
|
12656
12681
|
|
|
12682
|
+
export declare interface StarProjectionFact {
|
|
12683
|
+
index: number;
|
|
12684
|
+
table?: string;
|
|
12685
|
+
expandedColumns: string[];
|
|
12686
|
+
}
|
|
12687
|
+
|
|
12657
12688
|
/**
|
|
12658
12689
|
* StDistance
|
|
12659
12690
|
*/
|
|
@@ -13718,6 +13749,12 @@ declare type TransformFunc = {
|
|
|
13718
13749
|
transform: Expression;
|
|
13719
13750
|
};
|
|
13720
13751
|
|
|
13752
|
+
export declare interface TransformFunctionFact {
|
|
13753
|
+
name: string;
|
|
13754
|
+
literalArgs: string[];
|
|
13755
|
+
columnArgs: ColumnReferenceFact[];
|
|
13756
|
+
}
|
|
13757
|
+
|
|
13721
13758
|
export declare type TransformKind = 'direct' | 'cast' | 'aggregation' | 'constant' | 'expression' | 'star';
|
|
13722
13759
|
|
|
13723
13760
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1065,6 +1065,7 @@ export declare namespace ast {
|
|
|
1065
1065
|
setDistinct,
|
|
1066
1066
|
setLimit,
|
|
1067
1067
|
setOffset,
|
|
1068
|
+
setOrderBy,
|
|
1068
1069
|
transform,
|
|
1069
1070
|
NodePath,
|
|
1070
1071
|
NodePredicate,
|
|
@@ -2910,6 +2911,13 @@ declare type Cte = {
|
|
|
2910
2911
|
comments?: Array<string>;
|
|
2911
2912
|
};
|
|
2912
2913
|
|
|
2914
|
+
export declare interface CteFact {
|
|
2915
|
+
name: string;
|
|
2916
|
+
columns: string[];
|
|
2917
|
+
bodySql: string;
|
|
2918
|
+
outputColumns: string[];
|
|
2919
|
+
}
|
|
2920
|
+
|
|
2913
2921
|
/**
|
|
2914
2922
|
* Cube
|
|
2915
2923
|
*/
|
|
@@ -10870,11 +10878,15 @@ export declare interface ProjectionFact {
|
|
|
10870
10878
|
isStar: boolean;
|
|
10871
10879
|
starTable?: string;
|
|
10872
10880
|
transformKind: TransformKind;
|
|
10881
|
+
transformFunction?: TransformFunctionFact;
|
|
10873
10882
|
castType?: string;
|
|
10874
10883
|
typeHint?: string;
|
|
10884
|
+
nullability: ProjectionNullability;
|
|
10875
10885
|
upstream: ColumnReferenceFact[];
|
|
10876
10886
|
}
|
|
10877
10887
|
|
|
10888
|
+
export declare type ProjectionNullability = 'non_null' | 'nullable' | 'unknown';
|
|
10889
|
+
|
|
10878
10890
|
/**
|
|
10879
10891
|
* Properties
|
|
10880
10892
|
*/
|
|
@@ -11006,9 +11018,11 @@ declare type Quantile = {
|
|
|
11006
11018
|
export declare interface QueryAnalysis {
|
|
11007
11019
|
shape: QueryShape;
|
|
11008
11020
|
ctes: string[];
|
|
11021
|
+
cteFacts: CteFact[];
|
|
11009
11022
|
projections: ProjectionFact[];
|
|
11010
11023
|
relations: RelationFact[];
|
|
11011
11024
|
baseTables: RelationFact[];
|
|
11025
|
+
starProjections: StarProjectionFact[];
|
|
11012
11026
|
setOperations: SetOperationFact[];
|
|
11013
11027
|
}
|
|
11014
11028
|
|
|
@@ -11410,9 +11424,12 @@ declare type RegrValy = {
|
|
|
11410
11424
|
|
|
11411
11425
|
export declare interface RelationFact {
|
|
11412
11426
|
name: string;
|
|
11413
|
-
alias?: string;
|
|
11427
|
+
alias?: string | null;
|
|
11414
11428
|
kind: QueryAnalysisSourceKind;
|
|
11415
11429
|
columns: string[];
|
|
11430
|
+
catalog?: string | null;
|
|
11431
|
+
schema?: string | null;
|
|
11432
|
+
table?: string | null;
|
|
11416
11433
|
}
|
|
11417
11434
|
|
|
11418
11435
|
/**
|
|
@@ -12305,6 +12322,14 @@ export declare interface SetOperationFact {
|
|
|
12305
12322
|
|
|
12306
12323
|
export declare type SetOperationType = 'union' | 'union_all' | 'intersect' | 'except';
|
|
12307
12324
|
|
|
12325
|
+
/**
|
|
12326
|
+
* Set or update the ORDER BY clause.
|
|
12327
|
+
*
|
|
12328
|
+
* Bare expressions are normalized to ascending order entries. Existing
|
|
12329
|
+
* `ordered` expression nodes preserve their direction and null ordering.
|
|
12330
|
+
*/
|
|
12331
|
+
declare function setOrderBy(node: Expression, orderBy: Expression | Expression[]): Expression;
|
|
12332
|
+
|
|
12308
12333
|
/**
|
|
12309
12334
|
* SetProperty
|
|
12310
12335
|
*/
|
|
@@ -12654,6 +12679,12 @@ declare type Star = {
|
|
|
12654
12679
|
/** Create a star (*) expression. */
|
|
12655
12680
|
export declare function star(): Expr;
|
|
12656
12681
|
|
|
12682
|
+
export declare interface StarProjectionFact {
|
|
12683
|
+
index: number;
|
|
12684
|
+
table?: string;
|
|
12685
|
+
expandedColumns: string[];
|
|
12686
|
+
}
|
|
12687
|
+
|
|
12657
12688
|
/**
|
|
12658
12689
|
* StDistance
|
|
12659
12690
|
*/
|
|
@@ -13718,6 +13749,12 @@ declare type TransformFunc = {
|
|
|
13718
13749
|
transform: Expression;
|
|
13719
13750
|
};
|
|
13720
13751
|
|
|
13752
|
+
export declare interface TransformFunctionFact {
|
|
13753
|
+
name: string;
|
|
13754
|
+
literalArgs: string[];
|
|
13755
|
+
columnArgs: ColumnReferenceFact[];
|
|
13756
|
+
}
|
|
13757
|
+
|
|
13721
13758
|
export declare type TransformKind = 'direct' | 'cast' | 'aggregation' | 'constant' | 'expression' | 'star';
|
|
13722
13759
|
|
|
13723
13760
|
/**
|