@@ -299,10 +299,16 @@ export interface drop_index_stmt_node {
299
299
300
300
export type drop_stmt = AstStatement < drop_stmt_node > | AstStatement < drop_index_stmt_node > ;
301
301
302
+ export type truncate_table_name = table_name & { suffix ?: string } ;
303
+
304
+ export type truncate_table_name_list = truncate_table_name [ ] ;
305
+
302
306
export interface truncate_stmt_node {
303
307
type : 'trucate' ;
304
308
keyword : 'table' ;
309
+ prefix ?: string ;
305
310
name : table_ref_list ;
311
+ suffix : string [ ] ;
306
312
}
307
313
308
314
export type truncate_stmt = AstStatement < truncate_stmt_node > ;
@@ -559,7 +565,7 @@ export type table_option = {
559
565
keyword : 'auto_increment' | 'avg_row_length' | 'key_block_size' | 'max_rows' | 'min_rows' | 'stats_sample_pages' ;
560
566
symbol : '=' ;
561
567
value : number ; // <== literal_numeric['value']
562
- } | create_option_character_set | { keyword : 'connection' | 'comment' ; symbol : '=' ; value : string ; } | { keyword : 'compression' ; symbol : '=' ; value : "'ZLIB'" | "'LZ4'" | "'NONE'" } | { keyword : 'engine' ; symbol : '=' ; value : string ; } ;
568
+ } | create_option_character_set | { keyword : 'connection' | 'comment' ; symbol : '=' ; value : string ; } | { keyword : 'compression' ; symbol ? : '=' ; value : "'ZLIB'" | "'LZ4'" | "'NONE'" } | { keyword : 'engine' ; symbol ? : '=' ; value : string ; } | { keyword : 'partition by' ; value : expr ; } ;
563
569
564
570
export type ALTER_ADD_FULLETXT_SPARITAL_INDEX = create_fulltext_spatial_index_definition & { action : 'add' ; type : 'alter' } ;
565
571
@@ -770,6 +776,8 @@ export type column_clause = 'ALL' | '*' | column_list_item[] | column_list_item[
770
776
771
777
export type array_index = { brackets : boolean , number : number } ;
772
778
779
+ export type array_index_list = array_index [ ] ;
780
+
773
781
export type expr_item = binary_expr & { array_index : array_index } ;
774
782
775
783
export type cast_data_type = data_type & { quoted ?: string } ;
@@ -1103,32 +1111,38 @@ export type column_ref = string_constants_escape | {
1103
1111
property ?: ( literal_string | literal_numeric ) [ ] ;
1104
1112
} ;
1105
1113
1114
+ export type column_ref_quoted = IGNORE ;
1115
+
1106
1116
export type column_list = column [ ] ;
1107
1117
1118
+ export type ident_without_kw_type = { type : 'default' , value : string } | quoted_ident_type ;
1119
+
1120
+ export type ident_type = ident_name | quoted_ident_type ;
1121
+
1108
1122
export type ident = string ;
1109
1123
1110
1124
export type ident_list = ident [ ] ;
1111
1125
1112
1126
export type alias_ident = string ;
1113
1127
1114
- export type quoted_ident = double_quoted_ident | single_quoted_ident | backticks_quoted_ident ;
1115
-
1116
-
1128
+ export type quoted_ident_type = double_quoted_ident | single_quoted_ident | backticks_quoted_ident ;
1117
1129
1118
- export type double_quoted_ident = string ;
1130
+ export type quoted_ident = string ;
1119
1131
1132
+ export type double_quoted_ident = { type : 'double_quote_string' ; value : string ; } ;
1120
1133
1134
+ export type single_quoted_ident = { type : 'single_quote_string' ; value : string ; } ;
1121
1135
1122
- export type single_quoted_ident = string ;
1123
-
1124
-
1125
-
1126
- export type backticks_quoted_ident = string ;
1136
+ export type backticks_quoted_ident = { type : 'backticks_quote_string' ; value : string ; } ;
1127
1137
1128
1138
export type ident_without_kw = ident_name | quoted_ident ;
1129
1139
1130
1140
export type column_without_kw = column_name | quoted_ident ;
1131
1141
1142
+ export type column_without_kw_type = { type : 'default' , value : string } | quoted_ident_type ;
1143
+
1144
+ export type column_type = { type : 'default' , value : string } | quoted_ident_type ;
1145
+
1132
1146
1133
1147
1134
1148
export type column = string | quoted_ident ;
@@ -1199,11 +1213,11 @@ export type trim_position = "BOTH" | "LEADING" | "TRAILING";
1199
1213
1200
1214
export type trim_rem = expr_list ;
1201
1215
1202
- export type trim_func_clause = { type : 'function' ; name : string ; args : expr_list ; } ;
1216
+ export type trim_func_clause = { type : 'function' ; name : proc_func_name ; args : expr_list ; } ;
1203
1217
1204
- export type tablefunc_clause = { type : 'tablefunc' ; name : crosstab ; args : expr_list ; as : func_call } ;
1218
+ export type tablefunc_clause = { type : 'tablefunc' ; name : proc_func_name ; args : expr_list ; as : func_call } ;
1205
1219
1206
- export type func_call = trim_func_clause | tablefunc_clause | { type : 'function' ; name : string ; args : expr_list ; suffix : literal_string ; } | { type : 'function' ; name : string ; args : expr_list ; over ?: over_partition ; } | extract_func | { type : 'function' ; name : string ; over ?: on_update_current_timestamp ; } | { type : 'function' ; name : string ; args : expr_list ; } ;
1220
+ 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 ; } ;
1207
1221
1208
1222
export type extract_filed = 'string' ;
1209
1223
@@ -1262,7 +1276,9 @@ export type literal_not_null = { type: 'not null'; value: 'not null' };
1262
1276
1263
1277
export type literal_bool = { type : 'bool' , value : true } | { type : 'bool' , value : false } ;
1264
1278
1265
- export type literal_string = { type : 'single_quote_string' ; value : string ; } | { type : 'string' ; value : string ; } ;
1279
+ export type literal_string = { type : 'single_quote_string' ; value : string ; } | literal_double_quoted_string ;
1280
+
1281
+ export type literal_double_quoted_string = { type : 'string' ; value : string ; } ;
1266
1282
1267
1283
export type literal_datetime = { type : 'TIME' | 'DATE' | 'TIMESTAMP' | 'DATETIME' , value : string } ;
1268
1284
@@ -1730,7 +1746,7 @@ export type proc_join = { type: 'join'; ltable: var_decl; rtable: var_decl; op:
1730
1746
1731
1747
export type proc_primary = literal | var_decl | proc_func_call | param | proc_additive_expr & { parentheses : true ; } | { type : 'var' ; prefix : null ; name : number ; members : [ ] ; quoted : null } | column_ref ;
1732
1748
1733
- export type proc_func_name = string ;
1749
+ export type proc_func_name = { schema ?: ident_without_kw_type , name : ident_without_kw_type } ;
1734
1750
1735
1751
export type proc_func_call = { type : 'function' ; name : string ; args : null | { type : expr_list ; value : proc_primary_list ; } } ;
1736
1752
@@ -1831,4 +1847,6 @@ export type uuid_type = data_type;
1831
1847
1832
1848
1833
1849
1834
- export type record_type = data_type ;
1850
+ export type record_type = data_type ;
1851
+
1852
+ export type custom_types = data_type ;
0 commit comments