Skip to content

Commit 75bbe7a

Browse files
committed
refactor: upgrade version
1 parent 7fda7cf commit 75bbe7a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

ast/postgresql.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,8 @@ export type expr_item = binary_column_expr & { array_index: array_index };
900900

901901
export type cast_data_type = data_type & { quoted?: string };
902902

903+
export type column_item_suffix = [{ type: 'origin'; value: string; }, quoted_ident_type];
904+
903905
export type column_list_item = { expr: expr; as: null; } | { type: 'cast'; expr: expr; symbol: '::'; target: cast_data_type; as?: null; } | { expr: column_ref; as: null; } | { type: 'expr'; expr: expr; as?: alias_clause; };
904906

905907

@@ -1119,7 +1121,7 @@ export type value_list = value_item[];
11191121

11201122
export type value_item = expr_list;
11211123

1122-
export type expr_list = { type: 'expr_list'; value: expr[] };
1124+
export type expr_list = { type: 'expr_list'; value: expr[]; parentheses?: boolean; separator?: string; };
11231125

11241126
export type interval_expr = { type: 'interval', expr: expr; unit: interval_unit; };
11251127

@@ -1349,7 +1351,9 @@ export type trim_func_clause = { type: 'function'; name: proc_func_name; args: e
13491351

13501352
export type tablefunc_clause = { type: 'tablefunc'; name: proc_func_name; args: expr_list; as: func_call };
13511353

1352-
export type func_call = trim_func_clause | tablefunc_clause | { type: 'function'; name: proc_func_name; args: expr_list; suffix: literal_string; } | { type: 'function'; name: proc_func_name; args: expr_list; over?: over_partition; } | extract_func | { type: 'function'; name: proc_func_name; over?: on_update_current_timestamp; } | { type: 'function'; name: proc_func_name; args: expr_list; };
1354+
export type substring_funcs_clause = { type: 'function'; name: 'substring'; args: expr_list; };
1355+
1356+
export type func_call = trim_func_clause | tablefunc_clause | substring_funcs_clause | { type: 'function'; name: proc_func_name; args: expr_list; suffix: literal_string; } | { type: 'function'; name: proc_func_name; args: expr_list; over?: over_partition; } | extract_func | { type: 'function'; name: proc_func_name; over?: on_update_current_timestamp; } | { type: 'function'; name: proc_func_name; args: expr_list; };
13531357

13541358
export type extract_filed = 'string';
13551359

@@ -1870,7 +1874,9 @@ export type proc_stmt = AstStatement<proc_stmt_t>;
18701874

18711875
export type assign_stmt_list = assign_stmt[];
18721876

1873-
export type assign_stmt = { type: 'assign'; left: var_decl | without_prefix_var_decl; symbol: ':=' | '='; right: proc_expr; };
1877+
export type assign_stmt_timezone = { type: 'assign'; left: expr_list; symbol: 'to'; right: interval_unit; } | { type: 'assign'; left: literal_string; symbol?: 'to'; right: literal; };
1878+
1879+
export type assign_stmt = assign_stmt_timezone | { type: 'assign'; left: var_decl | without_prefix_var_decl; symbol: ':=' | '='; right: proc_expr; };
18741880

18751881
export type return_stmt = { type: 'return'; expr: proc_expr; };
18761882

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-sql-parser",
3-
"version": "5.3.3",
3+
"version": "5.3.4",
44
"description": "simple node sql parser",
55
"main": "index.js",
66
"types": "types.d.ts",

0 commit comments

Comments
 (0)