@@ -11,7 +11,7 @@ export type cmd_stmt = drop_stmt | create_stmt | declare_stmt | truncate_stmt |
11
11
12
12
export type create_stmt = create_table_stmt | create_constraint_trigger | create_extension_stmt | create_index_stmt | create_sequence | create_db_stmt | create_domain_stmt | create_type_stmt | create_view_stmt | create_aggregate_stmt ;
13
13
14
- export type alter_stmt = alter_table_stmt | alter_schema_stmt | alter_domain_type_stmt | alter_function_stmt | alter_aggregate_stmt ;
14
+ export type alter_stmt = alter_table_stmt | alter_schema_stmt | alter_domain_type_stmt | alter_function_stmt | alter_aggregate_stmt | alter_sequence_stmt ;
15
15
16
16
export type crud_stmt = union_stmt | update_stmt | replace_insert_stmt | insert_no_columns_stmt | delete_stmt | cmd_stmt | proc_stmts ;
17
17
@@ -399,6 +399,28 @@ export type alter_func_args = alter_func_arg_item[];
399
399
400
400
export type alter_aggregate_stmt = AstStatement < alter_resource_stmt_node > ;
401
401
402
+ export type alter_sequence_definition = { "resource" : "sequence" , prefix ?: string , value : literal_string }
403
+
404
+ export type alter_sequence_definition_owner = alter_sequence_definition ;
405
+
406
+ export type alter_sequence_definition_rename = alter_sequence_definition ;
407
+
408
+ export type alter_sequence_definition_set = alter_sequence_definition ;
409
+
410
+ export type alter_sequence_definition = alter_sequence_definition_owner | alter_sequence_definition_rename | alter_sequence_definition_set ;
411
+
412
+ export type alter_sequence_definition_list = alter_sequence_definition [ ] ;
413
+
414
+ export type alter_sequence_stmt = {
415
+ type : 'alter' ,
416
+ keyword : 'sequence' ,
417
+ if_exists ?: 'if exists' ,
418
+ sequence : [ table_name ] ,
419
+ create_definitions ?: create_sequence_definition_list | alter_sequence_definition_list
420
+ }
421
+
422
+ export type alter_sequence_stmt = AstStatement < alter_sequence_stmt > ;
423
+
402
424
export type alter_function_stmt = AstStatement < alter_resource_stmt_node > ;
403
425
404
426
export interface alter_resource_stmt_node {
@@ -1168,7 +1190,7 @@ export type case_expr = {
1168
1190
1169
1191
export type case_when_then_list = case_when_then [ ] ;
1170
1192
1171
- export type case_when_then = { type : 'when' ; cond : or_and_where_expr ; result : expr ; } ;
1193
+ export type case_when_then = { type : 'when' ; cond : or_and_expr ; result : expr_item ; } ;
1172
1194
1173
1195
export type case_else = { type : 'else' ; condition ?: never ; result : expr ; } ;
1174
1196
@@ -1251,7 +1273,9 @@ export type unary_expr_or_primary = jsonb_expr | unary_expr;
1251
1273
1252
1274
export type unary_operator = "!" | "-" | "+" | "~" ;
1253
1275
1254
- export type jsonb_expr = primary | binary_expr ;
1276
+ export type primary_array_index = primary & { array_index : array_index } ;
1277
+
1278
+ export type jsonb_expr = primary_array_index | binary_expr ;
1255
1279
1256
1280
export type string_constants_escape = { type : 'origin' ; value : string ; } ;
1257
1281
@@ -1370,6 +1394,10 @@ export type aggr_array_agg = { type: 'aggr_func'; args:count_arg; name: 'ARRAY_A
1370
1394
1371
1395
export type star_expr = { type : 'star' ; value : '*' } ;
1372
1396
1397
+ export type position_func_args = expr_list ;
1398
+
1399
+ export type position_func_clause = { type : 'function' ; name : string ; args : expr_list ; } ;
1400
+
1373
1401
export type trim_position = "BOTH" | "LEADING" | "TRAILING" ;
1374
1402
1375
1403
export type trim_rem = expr_list ;
@@ -1386,7 +1414,7 @@ export type make_interval_func_args = make_interval_func_args_item[] | expr_list
1386
1414
1387
1415
export type make_interval_func_clause = { type : 'function' ; name : proc_func_name ; args : make_interval_func_args ; } ;
1388
1416
1389
- export type func_call = trim_func_clause | tablefunc_clause | substring_funcs_clause | make_interval_func_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 ; } ;
1417
+ export type func_call = position_func_clause | trim_func_clause | tablefunc_clause | substring_funcs_clause | make_interval_func_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 ; } ;
1390
1418
1391
1419
export type extract_filed = 'string' ;
1392
1420
0 commit comments