@nocobase/plugin-collection-fdw 2.0.3

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.
Files changed (155) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +99 -0
  3. package/client.d.ts +2 -0
  4. package/client.js +1 -0
  5. package/dist/client/07d37b2045cf49ac.js +10 -0
  6. package/dist/client/19796e1ee00c3777.js +10 -0
  7. package/dist/client/545679e3c044a8fb.js +10 -0
  8. package/dist/client/components/CreateDatabaseServerAction.d.ts +10 -0
  9. package/dist/client/components/DatabaseServerSelect.d.ts +20 -0
  10. package/dist/client/components/EditDatabaseServerAction.d.ts +10 -0
  11. package/dist/client/components/PreviewFields.d.ts +10 -0
  12. package/dist/client/components/PreviewTable.d.ts +10 -0
  13. package/dist/client/components/RemoteTableSelect.d.ts +10 -0
  14. package/dist/client/components/SyncFieldsAction.d.ts +11 -0
  15. package/dist/client/components/UnSupportFields.d.ts +12 -0
  16. package/dist/client/components/schema.d.ts +19 -0
  17. package/dist/client/dccc3127ba4bb534.js +10 -0
  18. package/dist/client/ff008086e5ac8e5e.js +10 -0
  19. package/dist/client/hooks.d.ts +20 -0
  20. package/dist/client/index.d.ts +13 -0
  21. package/dist/client/index.js +10 -0
  22. package/dist/externalVersion.js +24 -0
  23. package/dist/index.d.ts +9 -0
  24. package/dist/index.js +42 -0
  25. package/dist/locale/de-DE.json +17 -0
  26. package/dist/locale/en-US.json +17 -0
  27. package/dist/locale/es-ES.json +17 -0
  28. package/dist/locale/fr-FR.json +17 -0
  29. package/dist/locale/hu-HU.json +17 -0
  30. package/dist/locale/id-ID.json +17 -0
  31. package/dist/locale/index.d.ts +10 -0
  32. package/dist/locale/index.js +42 -0
  33. package/dist/locale/it-IT.json +17 -0
  34. package/dist/locale/ja-JP.json +17 -0
  35. package/dist/locale/ko-KR.json +17 -0
  36. package/dist/locale/nl-NL.json +17 -0
  37. package/dist/locale/pt-BR.json +17 -0
  38. package/dist/locale/ru-RU.json +18 -0
  39. package/dist/locale/tr-TR.json +17 -0
  40. package/dist/locale/uk-UA.json +17 -0
  41. package/dist/locale/vi-VN.json +17 -0
  42. package/dist/locale/zh-CN.json +17 -0
  43. package/dist/locale/zh-TW.json +17 -0
  44. package/dist/node_modules/node-sql-parser/LICENSE +201 -0
  45. package/dist/node_modules/node-sql-parser/ast/postgresql.ts +1834 -0
  46. package/dist/node_modules/node-sql-parser/build/bigquery.d.ts +1 -0
  47. package/dist/node_modules/node-sql-parser/build/bigquery.js +2 -0
  48. package/dist/node_modules/node-sql-parser/build/db2.d.ts +1 -0
  49. package/dist/node_modules/node-sql-parser/build/db2.js +2 -0
  50. package/dist/node_modules/node-sql-parser/build/flinksql.d.ts +1 -0
  51. package/dist/node_modules/node-sql-parser/build/flinksql.js +2 -0
  52. package/dist/node_modules/node-sql-parser/build/hive.d.ts +1 -0
  53. package/dist/node_modules/node-sql-parser/build/hive.js +2 -0
  54. package/dist/node_modules/node-sql-parser/build/mariadb.d.ts +1 -0
  55. package/dist/node_modules/node-sql-parser/build/mariadb.js +2 -0
  56. package/dist/node_modules/node-sql-parser/build/mysql.d.ts +1 -0
  57. package/dist/node_modules/node-sql-parser/build/mysql.js +2 -0
  58. package/dist/node_modules/node-sql-parser/build/noql.d.ts +1 -0
  59. package/dist/node_modules/node-sql-parser/build/noql.js +2 -0
  60. package/dist/node_modules/node-sql-parser/build/postgresql.d.ts +1 -0
  61. package/dist/node_modules/node-sql-parser/build/postgresql.js +2 -0
  62. package/dist/node_modules/node-sql-parser/build/snowflake.d.ts +1 -0
  63. package/dist/node_modules/node-sql-parser/build/snowflake.js +2 -0
  64. package/dist/node_modules/node-sql-parser/build/sqlite.d.ts +1 -0
  65. package/dist/node_modules/node-sql-parser/build/sqlite.js +2 -0
  66. package/dist/node_modules/node-sql-parser/build/transactsql.d.ts +1 -0
  67. package/dist/node_modules/node-sql-parser/build/transactsql.js +2 -0
  68. package/dist/node_modules/node-sql-parser/index.d.ts +1 -0
  69. package/dist/node_modules/node-sql-parser/index.js +1 -0
  70. package/dist/node_modules/node-sql-parser/lib/aggregation.js +39 -0
  71. package/dist/node_modules/node-sql-parser/lib/alter.js +174 -0
  72. package/dist/node_modules/node-sql-parser/lib/analyze.js +40 -0
  73. package/dist/node_modules/node-sql-parser/lib/array-struct.js +60 -0
  74. package/dist/node_modules/node-sql-parser/lib/assign.js +33 -0
  75. package/dist/node_modules/node-sql-parser/lib/binary.js +46 -0
  76. package/dist/node_modules/node-sql-parser/lib/case.js +39 -0
  77. package/dist/node_modules/node-sql-parser/lib/column.js +221 -0
  78. package/dist/node_modules/node-sql-parser/lib/command.js +299 -0
  79. package/dist/node_modules/node-sql-parser/lib/constrain.js +45 -0
  80. package/dist/node_modules/node-sql-parser/lib/create.js +439 -0
  81. package/dist/node_modules/node-sql-parser/lib/delete.js +42 -0
  82. package/dist/node_modules/node-sql-parser/lib/exec.js +37 -0
  83. package/dist/node_modules/node-sql-parser/lib/expr.js +123 -0
  84. package/dist/node_modules/node-sql-parser/lib/func.js +152 -0
  85. package/dist/node_modules/node-sql-parser/lib/index-definition.js +106 -0
  86. package/dist/node_modules/node-sql-parser/lib/insert.js +111 -0
  87. package/dist/node_modules/node-sql-parser/lib/interval.js +28 -0
  88. package/dist/node_modules/node-sql-parser/lib/json.js +28 -0
  89. package/dist/node_modules/node-sql-parser/lib/limit.js +45 -0
  90. package/dist/node_modules/node-sql-parser/lib/over.js +39 -0
  91. package/dist/node_modules/node-sql-parser/lib/parser.all.js +33 -0
  92. package/dist/node_modules/node-sql-parser/lib/parser.js +82 -0
  93. package/dist/node_modules/node-sql-parser/lib/parser.single.js +23 -0
  94. package/dist/node_modules/node-sql-parser/lib/proc.js +39 -0
  95. package/dist/node_modules/node-sql-parser/lib/select.js +132 -0
  96. package/dist/node_modules/node-sql-parser/lib/show.js +88 -0
  97. package/dist/node_modules/node-sql-parser/lib/sql.js +43 -0
  98. package/dist/node_modules/node-sql-parser/lib/tables.js +211 -0
  99. package/dist/node_modules/node-sql-parser/lib/transaction.js +26 -0
  100. package/dist/node_modules/node-sql-parser/lib/union.js +81 -0
  101. package/dist/node_modules/node-sql-parser/lib/update.js +59 -0
  102. package/dist/node_modules/node-sql-parser/lib/util.js +444 -0
  103. package/dist/node_modules/node-sql-parser/lib/window.js +85 -0
  104. package/dist/node_modules/node-sql-parser/lib/with.js +37 -0
  105. package/dist/node_modules/node-sql-parser/package.json +1 -0
  106. package/dist/node_modules/node-sql-parser/types.d.ts +227 -0
  107. package/dist/node_modules/node-sql-parser/umd/bigquery.umd.d.ts +1 -0
  108. package/dist/node_modules/node-sql-parser/umd/bigquery.umd.js +2 -0
  109. package/dist/node_modules/node-sql-parser/umd/db2.umd.d.ts +1 -0
  110. package/dist/node_modules/node-sql-parser/umd/db2.umd.js +2 -0
  111. package/dist/node_modules/node-sql-parser/umd/flinksql.umd.d.ts +1 -0
  112. package/dist/node_modules/node-sql-parser/umd/flinksql.umd.js +2 -0
  113. package/dist/node_modules/node-sql-parser/umd/hive.umd.d.ts +1 -0
  114. package/dist/node_modules/node-sql-parser/umd/hive.umd.js +2 -0
  115. package/dist/node_modules/node-sql-parser/umd/index.umd.d.ts +1 -0
  116. package/dist/node_modules/node-sql-parser/umd/index.umd.js +2 -0
  117. package/dist/node_modules/node-sql-parser/umd/mariadb.umd.d.ts +1 -0
  118. package/dist/node_modules/node-sql-parser/umd/mariadb.umd.js +2 -0
  119. package/dist/node_modules/node-sql-parser/umd/mysql.umd.d.ts +1 -0
  120. package/dist/node_modules/node-sql-parser/umd/mysql.umd.js +2 -0
  121. package/dist/node_modules/node-sql-parser/umd/noql.umd.d.ts +1 -0
  122. package/dist/node_modules/node-sql-parser/umd/noql.umd.js +2 -0
  123. package/dist/node_modules/node-sql-parser/umd/postgresql.umd.d.ts +1 -0
  124. package/dist/node_modules/node-sql-parser/umd/postgresql.umd.js +2 -0
  125. package/dist/node_modules/node-sql-parser/umd/snowflake.umd.d.ts +1 -0
  126. package/dist/node_modules/node-sql-parser/umd/snowflake.umd.js +2 -0
  127. package/dist/node_modules/node-sql-parser/umd/sqlite.umd.d.ts +1 -0
  128. package/dist/node_modules/node-sql-parser/umd/sqlite.umd.js +2 -0
  129. package/dist/node_modules/node-sql-parser/umd/transactsql.umd.d.ts +1 -0
  130. package/dist/node_modules/node-sql-parser/umd/transactsql.umd.js +2 -0
  131. package/dist/server/bridges/mariadb-to-mariadb.d.ts +3 -0
  132. package/dist/server/bridges/mariadb-to-mariadb.js +38 -0
  133. package/dist/server/bridges/mysql-to-mysql.d.ts +13 -0
  134. package/dist/server/bridges/mysql-to-mysql.js +117 -0
  135. package/dist/server/bridges/mysql-to-pg.d.ts +8 -0
  136. package/dist/server/bridges/mysql-to-pg.js +9 -0
  137. package/dist/server/bridges/pg-to-pg.d.ts +21 -0
  138. package/dist/server/bridges/pg-to-pg.js +137 -0
  139. package/dist/server/bridges/remote-local-bridge.d.ts +57 -0
  140. package/dist/server/bridges/remote-local-bridge.js +73 -0
  141. package/dist/server/collections/database-server-collection.d.ts +10 -0
  142. package/dist/server/collections/database-server-collection.js +54 -0
  143. package/dist/server/foreign-data-collection.d.ts +22 -0
  144. package/dist/server/foreign-data-collection.js +118 -0
  145. package/dist/server/index.d.ts +9 -0
  146. package/dist/server/index.js +42 -0
  147. package/dist/server/models/database-server.d.ts +29 -0
  148. package/dist/server/models/database-server.js +226 -0
  149. package/dist/server/plugin.d.ts +14 -0
  150. package/dist/server/plugin.js +111 -0
  151. package/dist/server/resourcers/tables.d.ts +17 -0
  152. package/dist/server/resourcers/tables.js +181 -0
  153. package/package.json +43 -0
  154. package/server.d.ts +2 -0
  155. package/server.js +1 -0
@@ -0,0 +1,1834 @@
1
+
2
+ /*
3
+ ⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔
4
+ ⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔ THIS FILE HAS BEEN AUTO-GENERATED DO NOT EDIT IT ! ⛔⛔⛔⛔⛔⛔⛔⛔
5
+ ⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔⛔
6
+ */
7
+
8
+ export type start = multiple_stmt | create_function_stmt;
9
+
10
+ export type cmd_stmt = drop_stmt | create_stmt | declare_stmt | truncate_stmt | rename_stmt | call_stmt | use_stmt | alter_stmt | set_stmt | lock_stmt | show_stmt | deallocate_stmt | grant_revoke_stmt | if_else_stmt | raise_stmt | execute_stmt | for_loop_stmt | transaction_stmt;
11
+
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
+
14
+ export type alter_stmt = alter_table_stmt | alter_schema_stmt | alter_domain_type_stmt | alter_function_stmt | alter_aggregate_stmt;
15
+
16
+ export type crud_stmt = union_stmt | update_stmt | replace_insert_stmt | insert_no_columns_stmt | delete_stmt | cmd_stmt | proc_stmts;
17
+
18
+ // is in reality: { tableList: any[]; columnList: any[]; ast: T; }
19
+ export type AstStatement<T> = T;
20
+
21
+ export type multiple_stmt = AstStatement<curd_stmt | crud_stmt[]>;
22
+
23
+ export type set_op = 'union' | 'union all' | 'union distinct' | 'intersect | 'except';
24
+
25
+ export interface union_stmt_node extends select_stmt_node {
26
+ _next: union_stmt_node;
27
+ set_op: 'union' | 'union all' | 'union distinct';
28
+ }
29
+
30
+ export type union_stmt = AstStatement<union_stmt_node>;
31
+
32
+ export type if_not_exists_stmt = 'IF NOT EXISTS';
33
+
34
+ export type nameOrLiteral = literal_string | { type: 'same', value: string; };
35
+
36
+ export type create_extension_stmt = {
37
+ type: 'create';
38
+ keyword: 'extension';
39
+ if_not_exists?: 'if not exists';
40
+ extension: nameOrLiteral;
41
+ with: 'with';
42
+ schema: nameOrLiteral;
43
+ version: nameOrLiteral;
44
+ from: nameOrLiteral;
45
+ };
46
+
47
+ export type create_db_definition = create_option_character_set[];
48
+
49
+ export type create_db_stmt = {
50
+ type: 'create',
51
+ keyword: 'database' | 'schema',
52
+ if_not_exists?: 'if not exists',
53
+ database: string,
54
+ create_definitions?: create_db_definition
55
+ }
56
+
57
+ export type create_db_stmt = AstStatement<create_db_stmt>;
58
+
59
+ export type view_with = string;
60
+
61
+ export type with_view_option = {type: string; value: string; symbol: string; };
62
+
63
+ export type with_view_options = with_view_option[];
64
+
65
+ export type create_view_stmt = {
66
+ type: 'create',
67
+ keyword: 'view',
68
+ replace?: 'or replace',
69
+ temporary?: 'temporary' | 'temp',
70
+ recursive?: 'recursive',
71
+ view: table_name,
72
+ columns?: column_list,
73
+ select: select_stmt_nake,
74
+ with_options?: with_options,
75
+ with?: string,
76
+ }
77
+
78
+ export type create_view_stmt = AstStatement<create_view_stmt>;
79
+
80
+ export type create_aggregate_opt_required = { type: string; symbol: '='; value: expr; }[];
81
+
82
+ export type create_aggregate_opt_optional = { type: string; symbol: '='; value: ident | expr; };
83
+
84
+ export type create_aggregate_opts = create_aggregate_opt_optional[];
85
+
86
+ export type create_aggregate_stmt = {
87
+ type: 'create',
88
+ keyword: 'aggregate',
89
+ replace?: 'or replace',
90
+ name: table_name,
91
+ args?: aggregate_signature,
92
+ options: create_aggregate_opt_optional[]
93
+ }
94
+
95
+ export type create_aggregate_stmt = AstStatement<create_aggregate_stmt>;
96
+
97
+ export type column_data_type = { column: column_ref; definition: data_type; };
98
+
99
+ export type column_data_type_list = column_data_type[];
100
+
101
+ export type func_returns = { type: "returns"; keyword?: "setof"; expr: data_type; } | { type: "returns"; keyword?: "table"; expr: column_data_type_list; };
102
+
103
+ export type declare_variable_item = { keyword: 'variable'; name: string, constant?: string; datatype: data_type; collate?: collate; not_null?: string; default?: { type: 'default'; keyword: string; value: literal | expr; }; };
104
+
105
+ export type declare_variables = declare_variable_item[];
106
+
107
+ export type declare_stmt = { type: 'declare'; declare: declare_variable_item[]; }
108
+
109
+ export type declare_stmt = AstStatement<declare_stmt>;
110
+
111
+ export type create_func_opt = literal_string | { type: 'as'; begin?: string; declare?: declare_stmt; expr: multiple_stmt; end?: string; symbol: string; } | literal_numeric | { type: "set"; parameter: ident_name; value?: { prefix: string; expr: expr }};
112
+
113
+ export type create_function_stmt = {
114
+ type: 'create';
115
+ replace?: string;
116
+ name: { schema?: string; name: string };
117
+ args?: alter_func_args;
118
+ returns?: func_returns;
119
+ keyword: 'function';
120
+ options?: create_func_opt[];
121
+ }
122
+
123
+ export type create_function_stmt = AstStatement<create_function_stmt>;
124
+
125
+ export type create_type_stmt = {
126
+ type: 'create',
127
+ keyword: 'type',
128
+ name: { schema: string; name: string },
129
+ as?: string,
130
+ resource?: string,
131
+ create_definitions?: any
132
+ }
133
+
134
+ export type create_type_stmt = AstStatement<create_type_stmt>;
135
+
136
+ export type create_domain_stmt = {
137
+ type: 'create',
138
+ keyword: 'domain',
139
+ domain: { schema: string; name: string },
140
+ as?: string,
141
+ target: data_type,
142
+ create_definitions?: any[]
143
+ }
144
+
145
+ export type create_domain_stmt = AstStatement<create_domain_stmt>;
146
+
147
+ export type create_table_stmt_node = create_table_stmt_node_simple | create_table_stmt_node_like;
148
+ export interface create_table_stmt_node_base {
149
+ type: 'create';
150
+ keyword: 'table';
151
+ temporary?: 'temporary';
152
+ if_not_exists?: 'if not exists';
153
+ table: table_ref_list;
154
+ }
155
+ export interface create_table_stmt_node_simple extends create_table_stmt_node_base{
156
+ ignore_replace?: 'ignore' | 'replace';
157
+ as?: 'as';
158
+ query_expr?: union_stmt_node;
159
+ create_definitions?: create_table_definition;
160
+ table_options?: table_options;
161
+ }
162
+
163
+ export interface create_table_stmt_node_like extends create_table_stmt_node_base{
164
+ like: create_like_table;
165
+ }
166
+
167
+ export type create_table_stmt = AstStatement<create_table_stmt_node> | AstStatement<create_table_stmt_node>;;
168
+
169
+ export type create_sequence_stmt = {
170
+ type: 'create',
171
+ keyword: 'sequence',
172
+ temporary?: 'temporary' | 'temp',
173
+ if_not_exists?: 'if not exists',
174
+ table: table_ref_list,
175
+ create_definitions?: create_sequence_definition_list
176
+ }
177
+
178
+ export type create_sequence = AstStatement<create_sequence_stmt>;
179
+
180
+ export type sequence_definition = { "resource": "sequence", prefix?: string,value: literal | column_ref }
181
+
182
+ export type sequence_definition_increment = sequence_definition;
183
+
184
+ export type sequence_definition_minval = sequence_definition;
185
+
186
+ export type sequence_definition_maxval = sequence_definition;
187
+
188
+ export type sequence_definition_start = sequence_definition;
189
+
190
+ export type sequence_definition_cache = sequence_definition;
191
+
192
+ export type sequence_definition_cycle = sequence_definition;
193
+
194
+ export type sequence_definition_owned = sequence_definition;
195
+
196
+ export type create_sequence_definition = sequence_definition_increment | sequence_definition_minval | sequence_definition_maxval | sequence_definition_start | sequence_definition_cache | sequence_definition_cycle | sequence_definition_owned;
197
+
198
+ export type create_sequence_definition_list = create_sequence_definition[];
199
+
200
+ export interface create_index_stmt_node {
201
+ type: 'create';
202
+ index_type?: 'unique';
203
+ keyword: 'index';
204
+ concurrently?: 'concurrently';
205
+ index: string;
206
+ on_kw: string;
207
+ table: table_name;
208
+ index_using?: index_type;
209
+ index_columns: column_order[];
210
+ with?: index_option[];
211
+ with_before_where: true;
212
+ tablespace?: {type: 'origin'; value: string; }
213
+ where?: where_clause;
214
+ }
215
+
216
+ export type create_index_stmt = AstStatement<create_index_stmt_node>;
217
+
218
+ export type column_order_list = column_order[];
219
+
220
+
221
+
222
+ export type column_order = {
223
+ collate: collate_expr;
224
+ opclass: ident;
225
+ order: 'asc' | 'desc';
226
+ nulls: 'nulls last' | 'nulls first';
227
+ };
228
+
229
+ export type create_like_table_simple = { type: 'like'; table: table_ref_list; };
230
+
231
+ export type create_like_table = create_like_table_simple | create_like_table_simple & { parentheses?: boolean; };
232
+
233
+ export type create_table_definition = create_definition[];
234
+
235
+ export type create_definition = create_column_definition | create_index_definition | create_fulltext_spatial_index_definition | create_constraint_definition;
236
+
237
+ export type column_definition_opt = column_constraint | { auto_increment: 'auto_increment'; } | { unique: 'unique' | 'unique key'; } | { unique: 'key' | 'primary key'; } | { comment: keyword_comment; } | { collate: collate_expr; } | { column_format: column_format; } | { storage: storage } | { reference_definition: reference_definition; } | { character_set: collate_expr };
238
+
239
+
240
+
241
+ export type column_definition_opt_list = {
242
+ nullable?: column_constraint['nullable'];
243
+ default_val?: column_constraint['default_val'];
244
+ auto_increment?: 'auto_increment';
245
+ unique?: 'unique' | 'unique key';
246
+ primary?: 'key' | 'primary key';
247
+ comment?: keyword_comment;
248
+ collate?: collate_expr;
249
+ column_format?: column_format;
250
+ storage?: storage;
251
+ reference_definition?: reference_definition;
252
+ };
253
+
254
+
255
+
256
+ export type create_column_definition = {
257
+ column: column_ref;
258
+ definition: data_type;
259
+ nullable: column_constraint['nullable'];
260
+ default_val: column_constraint['default_val'];
261
+ auto_increment?: 'auto_increment';
262
+ unique?: 'unique' | 'unique key';
263
+ primary?: 'key' | 'primary key';
264
+ comment?: keyword_comment;
265
+ collate?: collate_expr;
266
+ column_format?: column_format;
267
+ storage?: storage;
268
+ reference_definition?: reference_definition;
269
+ resource: 'column';
270
+ };
271
+
272
+ export type column_constraint = { nullable: literal_null | literal_not_null; default_val: default_expr; };
273
+
274
+ export type collate_expr = { type: 'collate'; symbol: '=' | null; value: ident; };
275
+
276
+ export type column_format = { type: 'column_format'; value: 'fixed' | 'dynamic' | 'default'; };
277
+
278
+ export type storage = { type: 'storage'; value: 'disk' | 'memory' };
279
+
280
+ export type default_arg_expr = { type: 'default'; keyword: string, value: literal | expr; };
281
+
282
+ export type default_expr = { type: 'default'; value: literal | expr; };
283
+
284
+ export type drop_index_opt = (ALTER_ALGORITHM | ALTER_LOCK)[];
285
+
286
+ export interface drop_stmt_node {
287
+ type: 'drop';
288
+ keyword: 'table';
289
+ name: table_ref_list;
290
+ }
291
+
292
+ export interface drop_index_stmt_node {
293
+ type: 'drop';
294
+ prefix?: 'CONCURRENTLY';
295
+ keyword: string;
296
+ name: column_ref;
297
+ options?: 'cascade' | 'restrict';
298
+ }
299
+
300
+ export type drop_stmt = AstStatement<drop_stmt_node> | AstStatement<drop_index_stmt_node>;
301
+
302
+ export interface truncate_stmt_node {
303
+ type: 'trucate';
304
+ keyword: 'table';
305
+ name: table_ref_list;
306
+ }
307
+
308
+ export type truncate_stmt = AstStatement<truncate_stmt_node>;
309
+
310
+ export interface use_stmt_node {
311
+ type: 'use';
312
+ db: ident;
313
+ }
314
+
315
+ export type use_stmt = AstStatement<use_stmt_node>;
316
+
317
+ export type aggregate_signature = { name: ”*“ } | alter_func_args;
318
+
319
+ export type alter_func_argmode = ignore;
320
+
321
+ export type alter_func_arg_item = { mode?: string; name?: string; type: data_type; default: default_arg_expr; };
322
+
323
+ export type alter_func_args = alter_func_arg_item[];
324
+
325
+ export type alter_aggregate_stmt = AstStatement<alter_resource_stmt_node>;
326
+
327
+ export type alter_function_stmt = AstStatement<alter_resource_stmt_node>;
328
+
329
+ export interface alter_resource_stmt_node {
330
+ type: 'alter';
331
+ keyword: 'domain' | 'type',
332
+ name: string | { schema: string, name: string };
333
+ args?: { parentheses: true; expr?: alter_func_args; orderby?: alter_func_args; };
334
+ expr: alter_rename_owner;
335
+ }
336
+
337
+ export type alter_domain_type_stmt = AstStatement<alter_resource_stmt_node>;
338
+
339
+ export type alter_schema_stmt = AstStatement<alter_resource_stmt_node>;
340
+
341
+ export interface alter_table_stmt_node {
342
+ type: 'alter';
343
+ table: table_ref_list;
344
+ expr: alter_action_list;
345
+ }
346
+
347
+ export type alter_table_stmt = AstStatement<alter_table_stmt_node>;
348
+
349
+ export type alter_action_list = alter_action[];
350
+
351
+ export type alter_action = ALTER_ADD_COLUMN | ALTER_ADD_CONSTRAINT | ALTER_DROP_COLUMN | ALTER_ADD_INDEX_OR_KEY | ALTER_ADD_FULLETXT_SPARITAL_INDEX | ALTER_RENAME | ALTER_ALGORITHM | ALTER_LOCK;
352
+
353
+
354
+
355
+ export type ALTER_ADD_COLUMN = {
356
+ action: 'add';
357
+ keyword: KW_COLUMN;
358
+ resource: 'column';
359
+ type: 'alter';
360
+ } & create_column_definition;;
361
+
362
+
363
+
364
+ export type ALTER_DROP_COLUMN = {
365
+ action: 'drop';
366
+ collumn: column_ref;
367
+ keyword: KW_COLUMN;
368
+ resource: 'column';
369
+ type: 'alter';
370
+ };
371
+
372
+
373
+
374
+ export type ALTER_ADD_CONSTRAINT = {
375
+ action: 'add';
376
+ create_definitions: create_db_definition;
377
+ resource: 'constraint';
378
+ type: 'alter';
379
+ };
380
+
381
+
382
+
383
+ export type ALTER_ADD_INDEX_OR_KEY = {
384
+ action: 'add';
385
+ type: 'alter';
386
+ } & create_index_definition;
387
+
388
+ export interface alter_rename_owner {
389
+ action: string;
390
+ type: 'alter';
391
+ resource: string;
392
+ keyword?: 'to' | 'as';
393
+ [key: string]: ident;
394
+ }
395
+
396
+ export type ALTER_RENAME = AstStatement<alter_rename>;
397
+
398
+ export type ALTER_OWNER_TO = AstStatement<alter_rename_owner>;
399
+
400
+ export type ALTER_SET_SCHEMA = AstStatement<alter_rename_owner>;
401
+
402
+
403
+
404
+ export type ALTER_ALGORITHM = {
405
+ type: 'alter';
406
+ keyword: 'algorithm';
407
+ resource: 'algorithm';
408
+ symbol?: '=';
409
+ algorithm: 'DEFAULT' | 'INSTANT' | 'INPLACE' | 'COPY';
410
+ };
411
+
412
+
413
+
414
+ export type ALTER_LOCK = {
415
+ type: 'alter';
416
+ keyword: 'lock';
417
+ resource: 'lock';
418
+ symbol?: '=';
419
+ lock: 'DEFAULT' | 'NONE' | 'SHARED' | 'EXCLUSIVE';
420
+ };
421
+
422
+
423
+
424
+ export type create_index_definition = {
425
+ index: column;
426
+ definition: cte_column_definition;
427
+ keyword: 'index' | 'key';
428
+ index_type?: index_type;
429
+ resource: 'index';
430
+ index_options?: index_options;
431
+ };
432
+
433
+
434
+
435
+ export type create_fulltext_spatial_index_definition = {
436
+ index: column;
437
+ definition: cte_column_definition;
438
+ keyword: 'fulltext' | 'spatial' | 'fulltext key' | 'spatial key' | 'fulltext index' | 'spatial index';
439
+ index_options?: index_options;
440
+ resource: 'index';
441
+ };
442
+
443
+ export type create_constraint_definition = create_constraint_primary | create_constraint_unique | create_constraint_foreign | create_constraint_check;
444
+
445
+ export type constraint_name = { keyword: 'constraint'; constraint: ident; };
446
+
447
+
448
+
449
+ export type create_constraint_check = {
450
+ constraint?: constraint_name['constraint'];
451
+ definition: or_and_where_expr;
452
+ keyword?: constraint_name['keyword'];
453
+ constraint_type: 'check';
454
+ resource: 'constraint';
455
+ };
456
+
457
+
458
+
459
+ export type create_constraint_primary = {
460
+ constraint?: constraint_name['constraint'];
461
+ definition: cte_column_definition;
462
+ constraint_type: 'primary key';
463
+ keyword?: constraint_name['keyword'];
464
+ index_type?: index_type;
465
+ resource: 'constraint';
466
+ index_options?: index_options;
467
+ };
468
+
469
+
470
+
471
+ export type create_constraint_unique = {
472
+ constraint?: constraint_name['constraint'];
473
+ definition: cte_column_definition;
474
+ constraint_type: 'unique key' | 'unique' | 'unique index';
475
+ keyword?: constraint_name['keyword'];
476
+ index_type?: index_type;
477
+ resource: 'constraint';
478
+ index_options?: index_options;
479
+ };
480
+
481
+
482
+
483
+ export type create_constraint_foreign = {
484
+ constraint?: constraint_name['constraint'];
485
+ definition: cte_column_definition;
486
+ constraint_type: 'FOREIGN KEY';
487
+ keyword: constraint_name['keyword'];
488
+ index?: column;
489
+ resource: 'constraint';
490
+ reference_definition?: reference_definition;
491
+ };
492
+
493
+
494
+
495
+
496
+
497
+ export type reference_definition = {
498
+ definition: cte_column_definition;
499
+ table: table_ref_list;
500
+ keyword: 'references';
501
+ match: 'match full' | 'match partial' | 'match simple';
502
+ on_action: [on_reference?];
503
+ } | {
504
+ on_action: [on_reference];
505
+ };
506
+
507
+ export type on_reference = { type: 'on delete' | 'on update'; value: reference_option; };
508
+
509
+ export type reference_option = { type: 'function'; name: string; args: expr_list; } | 'restrict' | 'cascade' | 'set null' | 'no action' | 'set default' | 'current_timestamp';
510
+
511
+
512
+
513
+ export type create_constraint_trigger = {
514
+ type: 'create';
515
+ replace?: string;
516
+ constraint?: string;
517
+ location: 'before' | 'after' | 'instead of';
518
+ events: trigger_event_list;
519
+ table: table_name;
520
+ from?: table_name;
521
+ deferrable?: trigger_deferrable;
522
+ for_each?: trigger_for_row;
523
+ when?: trigger_when;
524
+ execute: {
525
+ keyword: string;
526
+ expr: proc_func_call;
527
+ };
528
+ constraint_type: 'trigger';
529
+ keyword: 'trigger';
530
+ constraint_kw: 'constraint';
531
+ resource: 'constraint';
532
+ };
533
+
534
+ export type trigger_event = { keyword: 'insert' | 'delete' | 'truncate' } | { keyword: 'update'; args?: { keyword: 'of', columns: column_ref_list; }};
535
+
536
+ export type trigger_event_list = trigger_event[];;
537
+
538
+ export type trigger_deferrable = { keyword: 'deferrable' | 'not deferrable'; args: 'initially immediate' | 'initially deferred' };
539
+
540
+ export type trigger_for_row = { keyword: 'for' | 'for each'; args: 'row' | 'statement' };
541
+
542
+ export type trigger_when = { type: 'when'; cond: expr; parentheses: true; };
543
+
544
+ export type table_options = table_option[];
545
+
546
+ export type create_option_character_set_kw = string;
547
+
548
+
549
+
550
+ export type create_option_character_set = {
551
+ keyword: 'character set' | 'charset' | 'collate' | 'default character set' | 'default charset' | 'default collate';
552
+ symbol: '=';
553
+ value: ident_name;
554
+ };
555
+
556
+
557
+
558
+ export type table_option = {
559
+ keyword: 'auto_increment' | 'avg_row_length' | 'key_block_size' | 'max_rows' | 'min_rows' | 'stats_sample_pages';
560
+ symbol: '=';
561
+ 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; };
563
+
564
+ export type ALTER_ADD_FULLETXT_SPARITAL_INDEX = create_fulltext_spatial_index_definition & { action: 'add'; type: 'alter' };
565
+
566
+ export interface rename_stmt_node {
567
+ type: 'rename';
568
+ table: table_to_list;
569
+ }
570
+
571
+ export type rename_stmt = AstStatement<rename_stmt_node>;
572
+
573
+ export interface set_stmt_node {
574
+ type: 'set';
575
+ expr: assign_stmt & { keyword?: 'GLOBAL' | 'SESSION' | 'LOCAL' | 'PERSIST' | 'PERSIST_ONLY'; };
576
+ }
577
+
578
+ export type set_stmt = AstStatement<set_stmt_node>;
579
+
580
+ export type lock_mode = { mode: string; };
581
+
582
+ export interface lock_stmt_node {
583
+ type: 'lock';
584
+ keyword: 'lock';
585
+ tables: [[table_base], ...{table: table_ref}[]]; // see table_ref_list
586
+ lock_mode?: lock_mode;
587
+ nowait?: 'NOWAIT';
588
+ }
589
+
590
+ export type lock_stmt = AstStatement<lock_stmt_node>;
591
+
592
+ export interface call_stmt_node {
593
+ type: 'call';
594
+ expr: proc_func_call;
595
+ }
596
+
597
+ export type call_stmt = AstStatement<call_stmt_node>;
598
+
599
+ export interface show_stmt_node {
600
+ type: 'show';
601
+ keyword: 'tables' | 'var';
602
+ var?: without_prefix_var_decl;
603
+ }
604
+
605
+ export type show_stmt = AstStatement<show_stmt_node>;
606
+
607
+ export interface deallocate_stmt_node {
608
+ type: 'deallocate';
609
+ keyword: 'PREPARE' | undefined;
610
+ expr: { type: 'default', value: string }
611
+ }
612
+
613
+ export type deallocate_stmt = AstStatement<deallocate_stmt_node>;
614
+
615
+ export interface origin_str_stmt {
616
+ type: 'origin';
617
+ value: string;
618
+ }
619
+
620
+ export type priv_type_table = origin_str_stmt;
621
+
622
+ export type priv_type_sequence = origin_str_stmt;
623
+
624
+ export type priv_type_database = origin_str_stmt;
625
+
626
+ export type prive_type_all = origin_str_stmt;
627
+
628
+ export type prive_type_usage = origin_str_stmt | prive_type_all;
629
+
630
+ export type prive_type_execute = origin_str_stmt | prive_type_all;
631
+
632
+ export type priv_type = priv_type_table | priv_type_sequence | priv_type_database | prive_type_usage | prive_type_execute;
633
+
634
+ export type priv_item = { priv: priv_type; columns: column_ref_list; };
635
+
636
+ export type priv_list = priv_item[];
637
+
638
+ export type object_type = origin_str_stmt;
639
+
640
+ export type priv_level = { prefix: string; name: string; };
641
+
642
+ export type priv_level_list = priv_level[];
643
+
644
+ export type user_or_role = origin_str_stmt;
645
+
646
+ export type user_or_role_list = user_or_role[];
647
+
648
+ export type with_grant_option = origin_str_stmt;
649
+
650
+ export type with_admin_option = origin_str_stmt;
651
+
652
+ export type grant_revoke_keyword = { type: 'grant' } | { type: 'revoke'; grant_option_for?: origin_str_stmt; };
653
+
654
+ export interface grant_revoke_stmt {
655
+ type: string;
656
+ grant_option_for?: origin_str_stmt;
657
+ keyword: 'priv';
658
+ objects: priv_list;
659
+ on: {
660
+ object_type?: object_type;
661
+ priv_level: priv_level_list;
662
+ };
663
+ to_from: 'to' | 'from';
664
+ user_or_roles?: user_or_role_list;
665
+ with?: with_grant_option;
666
+ }
667
+
668
+ export type grant_revoke_stmt = AstStatement<grant_revoke_stmt> | => AstStatement<grant_revoke_stmt>;
669
+
670
+ export type elseif_stmt = { type: 'elseif'; boolean_expr: expr; then: curd_stmt; semicolon?: string; };
671
+
672
+ export type elseif_stmt_list = elseif_stmt[];
673
+
674
+ export interface if_else_stmt {
675
+ type: 'if';
676
+ keyword: 'if';
677
+ boolean_expr: expr;
678
+ semicolons: string[];
679
+ if_expr: crud_stmt;
680
+ elseif_expr: elseif_stmt[];
681
+ else_expr: curd_stmt;
682
+ prefix: literal_string;
683
+ suffix: literal_string;
684
+ }
685
+
686
+ export type if_else_stmt = AstStatement<if_else_stmt>;
687
+
688
+ export type raise_level = "DEBUG" | "LOG" | "INFO" | "NOTICE" | "WARNING" | "EXCEPTION";
689
+
690
+ export type raise_opt = { type: 'using'; option: string; symbol: '='; expr: expr[]; };
691
+
692
+ type raise_item = never;
693
+
694
+ export interface raise_stmt {
695
+ type: 'raise';
696
+ level?: string;
697
+ raise?: raise_item;
698
+ using?: raise_opt;
699
+ }
700
+
701
+ export type raise_stmt = AstStatement<raise_stmt>;
702
+
703
+ export interface execute_stmt {
704
+ type: 'execute';
705
+ name: string;
706
+ args?: { type: expr_list; value: proc_primary_list; }
707
+ }
708
+
709
+ export type execute_stmt = AstStatement<execute_stmt>;
710
+
711
+ export type for_label = { label?: string; keyword: 'for'; };
712
+
713
+ export interface for_loop_stmt {
714
+ type: 'for';
715
+ label?: string
716
+ target: string;
717
+ query: select_stmt;
718
+ stmts: multiple_stmt;
719
+ }
720
+
721
+ export type for_loop_stmt = AstStatement<for_loop_stmt>;
722
+
723
+ export interface transaction_stmt {
724
+ type: 'transaction';
725
+ expr: {
726
+ type: 'origin',
727
+ value: string
728
+ }
729
+ }
730
+
731
+ export type transaction_stmt = AstStatement<transaction_stmt>;
732
+
733
+ export interface select_stmt_node extends select_stmt_nake {
734
+ parentheses: true;
735
+ }
736
+
737
+ export type select_stmt = { type: 'select'; } | select_stmt_nake | select_stmt_node;
738
+
739
+ export type with_clause = cte_definition[] | [cte_definition & { recursive: true; }];
740
+
741
+ export type cte_definition = { name: { type: 'default'; value: string; }; stmt: crud_stmt; columns?: cte_column_definition; };
742
+
743
+ export type cte_column_definition = column_ref_list;
744
+
745
+ export type distinct_on = {type: string; columns: column_ref_list;} | { type: string | undefined; };
746
+
747
+
748
+
749
+ export type select_stmt_nake = {
750
+ with?: with_clause;
751
+ type: 'select';
752
+ options?: option_clause;
753
+ distinct?: {type: string; columns?: column_list; };
754
+ columns: column_clause;
755
+ from?: from_clause;
756
+ into?: into_clause;
757
+ where?: where_clause;
758
+ groupby?: group_by_clause;
759
+ having?: having_clause;
760
+ orderby?: order_by_clause;
761
+ limit?: limit_clause;
762
+ window?: window_clause;
763
+ };
764
+
765
+ export type option_clause = query_option[];
766
+
767
+ export type query_option = 'SQL_CALC_FOUND_ROWS'| 'SQL_CACHE'| 'SQL_NO_CACHE'| 'SQL_BIG_RESULT'| 'SQL_SMALL_RESULT'| 'SQL_BUFFER_RESULT';
768
+
769
+ export type column_clause = 'ALL' | '*' | column_list_item[] | column_list_item[];
770
+
771
+ export type array_index = { brackets: boolean, number: number };
772
+
773
+ export type expr_item = binary_expr & { array_index: array_index };
774
+
775
+ export type cast_data_type = data_type & { quoted?: string };
776
+
777
+ export type column_list_item = { expr: expr; as: null; } | { type: 'cast'; expr: expr; symbol: '::'; target: cast_data_type; as?: null; arrows?: ('->>' | '->')[]; property?: (literal_string | literal_numeric)[]; } | { expr: column_ref; as: null; } | { type: 'expr'; expr: expr; as?: alias_clause; };
778
+
779
+
780
+
781
+ export type value_alias_clause = alias_ident;
782
+
783
+
784
+
785
+
786
+
787
+ export type alias_clause = alias_ident;
788
+
789
+ export type into_clause = { keyword: 'var'; type: 'into'; expr: var_decl_list; } | { keyword: 'var'; type: 'into'; expr: literal_string | ident; };
790
+
791
+
792
+
793
+ export type from_clause = table_ref_list;
794
+
795
+ export type table_to_list = table_to_item[];
796
+
797
+ export type table_to_item = table_name[];
798
+
799
+ export type index_type = { keyword: 'using'; type: 'btree' | 'hash' | 'gist' | 'gin' };
800
+
801
+ export type index_options_list = index_option[];
802
+
803
+ export type index_options = index_option[];
804
+
805
+ export type index_option = { type: 'key_block_size'; symbol: '='; expr: number; } | { type: ident_name; symbol: '='; expr: number | {type: 'origin'; value: ident; }; } | index_type | { type: 'with parser'; expr: ident_name } | { type: 'visible'; expr: 'visible' } | { type: 'invisible'; expr: 'invisible' } | keyword_comment;
806
+
807
+ export type table_ref_list = [table_base, ...table_ref[]];
808
+
809
+
810
+
811
+
812
+
813
+ export type table_ref = table_base | table_join;
814
+
815
+
816
+
817
+ export type table_join = table_base & {join: join_op; using: ident_name[]; } | table_base & {join: join_op; on?: on_clause; } | {
818
+ expr: (union_stmt || table_ref_list) & { parentheses: true; };
819
+ as?: alias_clause;
820
+ join: join_op;
821
+ on?: on_clause;
822
+ };
823
+
824
+ export type table_base = { type: 'dual' } | { expr: value_clause; as?: alias_clause; } | { prefix?: string; expr: union_stmt | value_clause; as?: alias_clause; } | { prefix?: string; expr: table_ref_list; as?: alias_clause; } | { prefix?: string; type: 'expr'; expr: expr; as?: alias_clause; } | table_name & { expr: expr, repeatable: literal_numeric; as?: alias_clause;} | table_name & { as?: alias_clause; };
825
+
826
+
827
+
828
+
829
+
830
+
831
+
832
+
833
+
834
+
835
+
836
+ export type join_op = 'LEFT JOIN' | 'RIGHT JOIN' | 'FULL JOIN' | 'CROSS JOIN' | 'INNER JOIN';
837
+
838
+ export type table_name = { db?: ident; schema?: ident, table: ident | '*'; };
839
+
840
+ export type or_and_expr = binary_expr;
841
+
842
+
843
+
844
+ export type on_clause = or_and_where_expr;
845
+
846
+
847
+
848
+ export type where_clause = or_and_where_expr;
849
+
850
+
851
+
852
+ export type group_by_clause = expr_list['value'];
853
+
854
+ export type column_ref_list = column_ref[];
855
+
856
+
857
+
858
+ export type having_clause = expr;
859
+
860
+ export type window_clause = { keyword: 'window'; type: 'window', expr: named_window_expr_list; };
861
+
862
+ export type named_window_expr_list = named_window_expr[];
863
+
864
+ export type named_window_expr = { name: ident_name; as_window_specification: as_window_specification; };
865
+
866
+ export type as_window_specification = ident_name | { window_specification: window_specification; parentheses: boolean };
867
+
868
+ export type window_specification = { name: null; partitionby: partition_by_clause; orderby: order_by_clause; window_frame_clause: string | null; };
869
+
870
+ export type window_specification_frameless = { name: null; partitionby: partition_by_clause; orderby: order_by_clause; window_frame_clause: null };
871
+
872
+ export type window_frame_clause = string;
873
+
874
+ export type window_frame_following = string | window_frame_current_row;
875
+
876
+ export type window_frame_preceding = string | window_frame_current_row;
877
+
878
+ export type window_frame_current_row = { type: 'single_quote_string'; value: string };
879
+
880
+ export type window_frame_value = literal_string | literal_numeric;
881
+
882
+
883
+
884
+ export type partition_by_clause = column_clause;
885
+
886
+
887
+
888
+ export type order_by_clause = order_by_list;
889
+
890
+ export type order_by_list = order_by_element[];
891
+
892
+ export type order_by_element = { expr: expr; type: 'ASC' | 'DESC' | undefined; nulls: 'NULLS FIRST' | 'NULLS LAST' | undefined };
893
+
894
+ export type number_or_param = literal_numeric | var_decl | param;
895
+
896
+ export type limit_clause = { separator: 'offset' | ''; value: [number_or_param | { type: 'origin', value: 'all' }, number_or_param?] };
897
+
898
+ export interface update_stmt_node {
899
+ with?: with_clause;
900
+ type: 'update';
901
+ table: table_ref_list;
902
+ set: set_list;
903
+ from?: from_clause;
904
+ where?: where_clause;
905
+ returning?: returning_stmt;
906
+ }
907
+
908
+ export type update_stmt = AstStatement<update_stmt_node>;
909
+
910
+ export interface table_ref_addition extends table_name {
911
+ addition: true;
912
+ as?: alias_clause;
913
+ }
914
+ export interface delete_stmt_node {
915
+ type: 'delete';
916
+ table?: table_ref_list | [table_ref_addition];
917
+ where?: where_clause;
918
+ }
919
+
920
+ export type delete_stmt = AstStatement<delete_stmt_node>;
921
+
922
+ export type set_list = set_item[];
923
+
924
+ export type set_item = { column: ident; value: additive_expr; table?: ident;} | { column: ident; value: column_ref; table?: ident; keyword: 'values' };
925
+
926
+ export type returning_stmt = { type: 'returning'; columns: column_clause | select_stmt; };
927
+
928
+ export type insert_value_clause = value_clause | select_stmt_nake;
929
+
930
+ export type insert_partition = ident_name[] | value_item;
931
+
932
+ export type conflict_target = { type: 'column'; expr: column_ref_list; parentheses: true; };
933
+
934
+ export type conflict_action = { keyword: "do"; expr: {type: 'origin'; value: string; }; } | { keyword: "do"; expr: {type: 'update'; set: set_list; where: where_clause; }; };
935
+
936
+ export type on_conflict = { type: "conflict"; keyword: "on"; target: conflict_target; action: conflict_action; };
937
+
938
+ export interface replace_insert_stmt_node {
939
+ type: 'insert' | 'replace';
940
+ table?: [table_name];
941
+ columns: column_list;
942
+ conflict?: on_conflict;
943
+ values: insert_value_clause;
944
+ partition?: insert_partition;
945
+ returning?: returning_stmt;
946
+ }
947
+
948
+ export type replace_insert_stmt = AstStatement<replace_insert_stmt_node>;
949
+
950
+ export type insert_no_columns_stmt = AstStatement<replace_insert_stmt_node>;
951
+
952
+
953
+
954
+
955
+
956
+ export type replace_insert = 'insert' | 'replace';
957
+
958
+
959
+
960
+ export type value_clause = value_list;
961
+
962
+ export type value_list = value_item[];
963
+
964
+ export type value_item = expr_list;
965
+
966
+ export type expr_list = { type: 'expr_list'; value: expr[] };
967
+
968
+ export type interval_expr = { type: 'interval', expr: expr; unit: interval_unit; };
969
+
970
+
971
+
972
+
973
+
974
+ export type case_expr = {
975
+ type: 'case';
976
+ expr: null;
977
+ // nb: Only the last element is a case_else
978
+ args: (case_when_then | case_else)[];
979
+ } | {
980
+ type: 'case';
981
+ expr: expr;
982
+ // nb: Only the last element is a case_else
983
+ args: (case_when_then | case_else)[];
984
+ };
985
+
986
+ export type case_when_then_list = case_when_then[];
987
+
988
+ export type case_when_then = { type: 'when'; cond: binary_expr; result: expr; };
989
+
990
+ export type case_else = { type: 'else'; condition?: never; result: expr; };
991
+
992
+ export type _expr = logic_operator_expr | or_expr | unary_expr;
993
+
994
+ export type expr = _expr | union_stmt;
995
+
996
+ export type BINARY_OPERATORS = LOGIC_OPERATOR | 'OR' | 'AND' | multiplicative_operator | additive_operator
997
+ | arithmetic_comparison_operator
998
+ | 'IN' | 'NOT IN'
999
+ | 'BETWEEN' | 'NOT BETWEEN'
1000
+ | 'IS' | 'IS NOT'
1001
+ | 'LIKE'
1002
+ | '@>' | '<@' | OPERATOR_CONCATENATION | DOUBLE_WELL_ARROW | WELL_ARROW | '?' | '?|' | '?&' | '#-'
1003
+ export interface binary_expr {
1004
+ type: 'binary_expr',
1005
+ operator: BINARY_OPERATORS,
1006
+ left: expr,
1007
+ right: expr
1008
+ }
1009
+
1010
+ export type logic_operator_expr = binary_expr;
1011
+
1012
+ export type UNARY_OPERATORS = '+' | '-' | 'EXISTS' | 'NOT EXISTS' | 'NULL'
1013
+
1014
+ export type unary_expr = {
1015
+ type: 'unary_expr',
1016
+ operator: UNARY_OPERATORS,
1017
+ expr: expr;
1018
+ parentheses?: boolean;
1019
+ };
1020
+
1021
+ export type binary_column_expr = binary_expr;
1022
+
1023
+ export type or_and_where_expr = binary_expr | { type: 'expr_list'; value: expr[] };
1024
+
1025
+ export type or_expr = binary_expr;
1026
+
1027
+ export type and_expr = binary_expr;
1028
+
1029
+ export type not_expr = comparison_expr | exists_expr | unary_expr;
1030
+
1031
+ export type comparison_expr = binary_expr | literal_string | column_ref;
1032
+
1033
+ export type exists_expr = unary_expr;
1034
+
1035
+
1036
+
1037
+ export type exists_op = 'NOT EXISTS' | KW_EXISTS;
1038
+
1039
+ export type comparison_op_right = arithmetic_op_right | in_op_right | between_op_right | is_op_right | like_op_right | jsonb_op_right | regex_op_right;
1040
+
1041
+ export type arithmetic_op_right = { type: 'arithmetic'; tail: any };
1042
+
1043
+ export type arithmetic_comparison_operator = ">=" | ">" | "<=" | "<>" | "<" | "=" | "!=";
1044
+
1045
+ export type is_op_right = { op: 'IS'; right: additive_expr; } | { type: 'origin'; value: string; } | { type: 'IS NOT'; right: additive_expr; };
1046
+
1047
+ export type between_op_right = { op: 'BETWEEN' | 'NOT BETWEEN'; right: { type: 'expr_list'; value: [expr, expr] } };
1048
+
1049
+
1050
+
1051
+ export type between_or_not_between_op = 'NOT BETWEEN' | KW_BETWEEN;
1052
+
1053
+
1054
+
1055
+ export type like_op = 'LIKE' | KW_LIKE | KW_ILIKE | 'SIMILAR TO' | 'NOT SIMILAR TO';
1056
+
1057
+ export type regex_op = "!~*" | "~*" | "~" | "!~";
1058
+
1059
+ export type regex_op_right = { op: regex_op; right: literal | comparison_expr};
1060
+
1061
+ export type escape_op = { type: 'ESCAPE'; value: literal_string };
1062
+
1063
+
1064
+
1065
+ export type in_op = 'NOT IN' | KW_IN;
1066
+
1067
+ export type like_op_right = { op: like_op; right: (literal | comparison_expr) & { escape?: escape_op }; };
1068
+
1069
+ export type in_op_right = {op: in_op; right: expr_list | var_decl | literal_string; };
1070
+
1071
+ export type jsonb_op_right = { op: string; right: expr };
1072
+
1073
+ export type additive_expr = binary_expr;
1074
+
1075
+ export type additive_operator = "+" | "-";
1076
+
1077
+ export type multiplicative_expr = binary_expr;
1078
+
1079
+ export type multiplicative_operator = "*" | "/" | "%" | "||";
1080
+
1081
+ export type column_ref_array_index = column_ref;
1082
+
1083
+ export type primary = cast_expr | or_and_where_expr | var_decl | { type: 'origin'; value: string; };
1084
+
1085
+ export type string_constants_escape = { type: 'origin'; value: string; };
1086
+
1087
+
1088
+
1089
+
1090
+
1091
+ export type column_ref = string_constants_escape | {
1092
+ type: 'column_ref';
1093
+ schema: string;
1094
+ table: string;
1095
+ column: column | '*';
1096
+ arrows?: ('->>' | '->')[];
1097
+ property?: (literal_string | literal_numeric)[];
1098
+ } | {
1099
+ type: 'column_ref';
1100
+ table: ident;
1101
+ column: column | '*';
1102
+ arrows?: ('->>' | '->')[];
1103
+ property?: (literal_string | literal_numeric)[];
1104
+ };
1105
+
1106
+ export type column_list = column[];
1107
+
1108
+ export type ident = string;
1109
+
1110
+ export type ident_list = ident[];
1111
+
1112
+ export type alias_ident = string;
1113
+
1114
+ export type quoted_ident = double_quoted_ident | single_quoted_ident | backticks_quoted_ident;
1115
+
1116
+
1117
+
1118
+ export type double_quoted_ident = string;
1119
+
1120
+
1121
+
1122
+ export type single_quoted_ident = string;
1123
+
1124
+
1125
+
1126
+ export type backticks_quoted_ident = string;
1127
+
1128
+ export type ident_without_kw = ident_name | quoted_ident;
1129
+
1130
+ export type column_without_kw = column_name | quoted_ident;
1131
+
1132
+
1133
+
1134
+ export type column = string | quoted_ident;
1135
+
1136
+
1137
+
1138
+ export type column_name = string;
1139
+
1140
+ export type ident_name = string;
1141
+
1142
+ type ident_start = never;
1143
+
1144
+ type ident_part = never;
1145
+
1146
+ type column_part = never;
1147
+
1148
+ export type param = { type: 'param'; value: ident_name };
1149
+
1150
+ export type on_update_current_timestamp = { type: 'on update'; keyword: string; parentheses: boolean; expr: expr } | { type: 'on update'; keyword: string; };
1151
+
1152
+ export type over_partition = { type: 'windows'; as_window_specification: as_window_specification } | { partitionby: partition_by_clause; orderby: order_by_clause } | on_update_current_timestamp;
1153
+
1154
+ export type aggr_filter = { keyword: 'filter'; parentheses: true, where: where_clause };
1155
+
1156
+ export type aggr_func = { type: 'aggr_func'; name: string; args: { expr: additive_expr } | count_arg; over: over_partition; filter?: aggr_filter; };
1157
+
1158
+ export type window_func = window_fun_rank | window_fun_laglead | window_fun_firstlast;
1159
+
1160
+ export type window_fun_rank = { type: 'window_func'; name: string; over: over_partition };
1161
+
1162
+ export type window_fun_laglead = { type: 'window_func'; name: string; args: expr_list; consider_nulls: null | string; over: over_partition };
1163
+
1164
+ export type window_fun_firstlast = window_fun_laglead;
1165
+
1166
+ type KW_FIRST_LAST_VALUE = never;
1167
+
1168
+ type KW_WIN_FNS_RANK = never;
1169
+
1170
+ type KW_LAG_LEAD = never;
1171
+
1172
+ export type consider_nulls_clause = string;
1173
+
1174
+ export type aggr_fun_smma = { type: 'aggr_func'; name: 'SUM' | 'MAX' | 'MIN' | 'AVG'; args: { expr: additive_expr }; over: over_partition };
1175
+
1176
+ type KW_SUM_MAX_MIN_AVG = never;
1177
+
1178
+ export type aggr_fun_count = { type: 'aggr_func'; name: 'COUNT' | 'GROUP_CONCAT'; args:count_arg; over: over_partition } | { type: 'aggr_func'; name: 'PERCENTILE_CONT' | 'PERCENTILE_DISC'; args: literal_numeric / literal_array; within_group_orderby: order_by_clause; over?: over_partition } | { type: 'aggr_func'; name: 'MODE'; args: literal_numeric / literal_array; within_group_orderby: order_by_clause; over?: over_partition };
1179
+
1180
+ export type concat_separator = { keyword: string | null; value: literal_string; };
1181
+
1182
+
1183
+
1184
+
1185
+
1186
+ export type distinct_args = { distinct: 'DISTINCT'; expr: expr; orderby?: order_by_clause; separator?: concat_separator; };
1187
+
1188
+
1189
+
1190
+ export type count_arg = { expr: star_expr } | distinct_args;
1191
+
1192
+ export type aggr_array_agg = { type: 'aggr_func'; args:count_arg; name: 'ARRAY_AGG'; orderby?: order_by_clause };
1193
+
1194
+
1195
+
1196
+ export type star_expr = { type: 'star'; value: '*' };
1197
+
1198
+ export type trim_position = "BOTH" | "LEADING" | "TRAILING";
1199
+
1200
+ export type trim_rem = expr_list;
1201
+
1202
+ export type trim_func_clause = { type: 'function'; name: string; args: expr_list; };
1203
+
1204
+ export type tablefunc_clause = { type: 'tablefunc'; name: crosstab; args: expr_list; as: func_call };
1205
+
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; };
1207
+
1208
+ export type extract_filed = 'string';
1209
+
1210
+ export type extract_func = { type: 'extract'; args: { field: extract_filed; cast_type: 'TIMESTAMP' | 'INTERVAL' | 'TIME'; source: expr; }} | { type: 'extract'; args: { field: extract_filed; source: expr; }};
1211
+
1212
+ export type scalar_time_func = KW_CURRENT_DATE | KW_CURRENT_TIME | KW_CURRENT_TIMESTAMP;
1213
+
1214
+ export type scalar_func = scalar_time_func | KW_CURRENT_USER | KW_USER | KW_SESSION_USER | KW_SYSTEM_USER | "NTILE";
1215
+
1216
+
1217
+
1218
+ export type cast_double_colon = {
1219
+ as?: alias_clause,
1220
+ symbol: '::' | 'as',
1221
+ target: data_type;
1222
+ arrows?: ('->>' | '->')[];
1223
+ property?: (literal_string | literal_numeric)[];
1224
+ };
1225
+
1226
+
1227
+
1228
+
1229
+
1230
+ export type cast_expr = {
1231
+ type: 'cast';
1232
+ expr: or_expr | column_ref | param
1233
+ | expr;
1234
+ keyword: 'cast';
1235
+ ...cast_double_colon;
1236
+ } | {
1237
+ type: 'cast';
1238
+ expr: literal | aggr_func | func_call | case_expr | interval_expr | column_ref | param
1239
+ | expr;
1240
+ keyword: 'cast';
1241
+ ...cast_double_colon;
1242
+ };
1243
+
1244
+ export type signedness = KW_SIGNED | KW_UNSIGNED;
1245
+
1246
+ export type literal = literal_string | literal_numeric | literal_bool | literal_null | literal_datetime | literal_array;
1247
+
1248
+
1249
+
1250
+ export type literal_array = {
1251
+ expr_list: expr_list | {type: 'origin', value: ident },
1252
+ type: string,
1253
+ keyword: string,
1254
+ brackets: boolean
1255
+ };
1256
+
1257
+ export type literal_list = literal[];
1258
+
1259
+ export type literal_null = { type: 'null'; value: null };
1260
+
1261
+ export type literal_not_null = { type: 'not null'; value: 'not null' };
1262
+
1263
+ export type literal_bool = { type: 'bool', value: true } | { type: 'bool', value: false };
1264
+
1265
+ export type literal_string = { type: 'single_quote_string'; value: string; } | { type: 'string'; value: string; };
1266
+
1267
+ export type literal_datetime = { type: 'TIME' | 'DATE' | 'TIMESTAMP' | 'DATETIME', value: string };
1268
+
1269
+ export type single_quote_char = string;
1270
+
1271
+ export type single_char = string;
1272
+
1273
+ export type escape_char = string;
1274
+
1275
+ export type line_terminator = string;
1276
+
1277
+ export type literal_numeric = number | { type: 'bigint'; value: string; };
1278
+
1279
+ export type int = string;
1280
+
1281
+ export type frac = string;
1282
+
1283
+ export type exp = string;
1284
+
1285
+ export type digits = string;
1286
+
1287
+ export type digit = string;
1288
+
1289
+ export type hexDigit = string;
1290
+
1291
+ export type e = string;
1292
+
1293
+ type KW_NULL = never;
1294
+
1295
+ type KW_DEFAULT = never;
1296
+
1297
+ type KW_NOT_NULL = never;
1298
+
1299
+ type KW_TRUE = never;
1300
+
1301
+ type KW_TO = never;
1302
+
1303
+ type KW_FALSE = never;
1304
+
1305
+ type KW_SHOW = never;
1306
+
1307
+ type KW_DROP = never;
1308
+
1309
+ type KW_USE = never;
1310
+
1311
+ type KW_ALTER = never;
1312
+
1313
+ type KW_SELECT = never;
1314
+
1315
+ type KW_UPDATE = never;
1316
+
1317
+ type KW_CREATE = never;
1318
+
1319
+ type KW_TEMPORARY = never;
1320
+
1321
+ type KW_TEMP = never;
1322
+
1323
+ type KW_DELETE = never;
1324
+
1325
+ type KW_INSERT = never;
1326
+
1327
+ type KW_RECURSIVE = never;
1328
+
1329
+ type KW_REPLACE = never;
1330
+
1331
+ type KW_RETURNING = never;
1332
+
1333
+ type KW_RENAME = never;
1334
+
1335
+ type KW_IGNORE = never;
1336
+
1337
+ type KW_EXPLAIN = never;
1338
+
1339
+ type KW_PARTITION = never;
1340
+
1341
+ type KW_INTO = never;
1342
+
1343
+ type KW_FROM = never;
1344
+
1345
+ type KW_SET = never;
1346
+
1347
+ type KW_LOCK = never;
1348
+
1349
+ type KW_AS = never;
1350
+
1351
+ type KW_TABLE = never;
1352
+
1353
+ type KW_DATABASE = never;
1354
+
1355
+ type KW_SCHEMA = never;
1356
+
1357
+ type KW_SEQUENCE = never;
1358
+
1359
+ type KW_TABLESPACE = never;
1360
+
1361
+ type KW_COLLATE = never;
1362
+
1363
+ type KW_DEALLOCATE = never;
1364
+
1365
+ type KW_ON = never;
1366
+
1367
+ type KW_LEFT = never;
1368
+
1369
+ type KW_RIGHT = never;
1370
+
1371
+ type KW_FULL = never;
1372
+
1373
+ type KW_INNER = never;
1374
+
1375
+ type KW_JOIN = never;
1376
+
1377
+ type KW_OUTER = never;
1378
+
1379
+ type KW_UNION = never;
1380
+
1381
+ type KW_INTERSECT = never;
1382
+
1383
+ type KW_EXCEPT = never;
1384
+
1385
+ type KW_VALUES = never;
1386
+
1387
+ type KW_USING = never;
1388
+
1389
+ type KW_WHERE = never;
1390
+
1391
+ type KW_WITH = never;
1392
+
1393
+ type KW_GROUP = never;
1394
+
1395
+ type KW_BY = never;
1396
+
1397
+ type KW_ORDER = never;
1398
+
1399
+ type KW_HAVING = never;
1400
+
1401
+ type KW_WINDOW = never;
1402
+
1403
+ type KW_LIMIT = never;
1404
+
1405
+ type KW_OFFSET = never;
1406
+
1407
+ type KW_ASC = never;
1408
+
1409
+ type KW_DESC = never;
1410
+
1411
+ type KW_ALL = never;
1412
+
1413
+ type KW_DISTINCT = never;
1414
+
1415
+ type KW_BETWEEN = never;
1416
+
1417
+ type KW_IN = never;
1418
+
1419
+ type KW_IS = never;
1420
+
1421
+ type KW_LIKE = never;
1422
+
1423
+ type KW_ILIKE = never;
1424
+
1425
+ type KW_EXISTS = never;
1426
+
1427
+ type KW_NOT = never;
1428
+
1429
+ type KW_AND = never;
1430
+
1431
+ type KW_OR = never;
1432
+
1433
+ type KW_ARRAY = never;
1434
+
1435
+ type KW_ARRAY_AGG = never;
1436
+
1437
+ type KW_COUNT = never;
1438
+
1439
+ type KW_GROUP_CONCAT = never;
1440
+
1441
+ type KW_MAX = never;
1442
+
1443
+ type KW_MIN = never;
1444
+
1445
+ type KW_SUM = never;
1446
+
1447
+ type KW_AVG = never;
1448
+
1449
+ type KW_EXTRACT = never;
1450
+
1451
+ type KW_CALL = never;
1452
+
1453
+ type KW_CASE = never;
1454
+
1455
+ type KW_WHEN = never;
1456
+
1457
+ type KW_THEN = never;
1458
+
1459
+ type KW_ELSE = never;
1460
+
1461
+ type KW_END = never;
1462
+
1463
+ type KW_CAST = never;
1464
+
1465
+ type KW_BOOL = never;
1466
+
1467
+ type KW_BOOLEAN = never;
1468
+
1469
+ type KW_CHAR = never;
1470
+
1471
+ type KW_CHARACTER = never;
1472
+
1473
+ type KW_VARCHAR = never;
1474
+
1475
+ type KW_NUMERIC = never;
1476
+
1477
+ type KW_DECIMAL = never;
1478
+
1479
+ type KW_SIGNED = never;
1480
+
1481
+ type KW_UNSIGNED = never;
1482
+
1483
+ type KW_INT = never;
1484
+
1485
+ type KW_ZEROFILL = never;
1486
+
1487
+ type KW_INTEGER = never;
1488
+
1489
+ type KW_JSON = never;
1490
+
1491
+ type KW_JSONB = never;
1492
+
1493
+ type KW_GEOMETRY = never;
1494
+
1495
+ type KW_SMALLINT = never;
1496
+
1497
+ type KW_SERIAL = never;
1498
+
1499
+ type KW_TINYINT = never;
1500
+
1501
+ type KW_TINYTEXT = never;
1502
+
1503
+ type KW_TEXT = never;
1504
+
1505
+ type KW_MEDIUMTEXT = never;
1506
+
1507
+ type KW_LONGTEXT = never;
1508
+
1509
+ type KW_BIGINT = never;
1510
+
1511
+ type KW_ENUM = never;
1512
+
1513
+ type KW_FLOAT = never;
1514
+
1515
+ type KW_DOUBLE = never;
1516
+
1517
+ type KW_BIGSERIAL = never;
1518
+
1519
+ type KW_REAL = never;
1520
+
1521
+ type KW_DATE = never;
1522
+
1523
+ type KW_DATETIME = never;
1524
+
1525
+ type KW_ROWS = never;
1526
+
1527
+ type KW_TIME = never;
1528
+
1529
+ type KW_TIMESTAMP = never;
1530
+
1531
+ type KW_TRUNCATE = never;
1532
+
1533
+ type KW_USER = never;
1534
+
1535
+ type KW_UUID = never;
1536
+
1537
+ type KW_OID = never;
1538
+
1539
+ type KW_REGCLASS = never;
1540
+
1541
+ type KW_REGCOLLATION = never;
1542
+
1543
+ type KW_REGCONFIG = never;
1544
+
1545
+ type KW_REGDICTIONARY = never;
1546
+
1547
+ type KW_REGNAMESPACE = never;
1548
+
1549
+ type KW_REGOPER = never;
1550
+
1551
+ type KW_REGOPERATOR = never;
1552
+
1553
+ type KW_REGPROC = never;
1554
+
1555
+ type KW_REGPROCEDURE = never;
1556
+
1557
+ type KW_REGROLE = never;
1558
+
1559
+ type KW_REGTYPE = never;
1560
+
1561
+ type KW_CURRENT_DATE = never;
1562
+
1563
+ type KW_ADD_DATE = never;
1564
+
1565
+ type KW_INTERVAL = never;
1566
+
1567
+ type KW_UNIT_YEAR = never;
1568
+
1569
+ type KW_UNIT_MONTH = never;
1570
+
1571
+ type KW_UNIT_DAY = never;
1572
+
1573
+ type KW_UNIT_HOUR = never;
1574
+
1575
+ type KW_UNIT_MINUTE = never;
1576
+
1577
+ type KW_UNIT_SECOND = never;
1578
+
1579
+ type KW_CURRENT_TIME = never;
1580
+
1581
+ type KW_CURRENT_TIMESTAMP = never;
1582
+
1583
+ type KW_CURRENT_USER = never;
1584
+
1585
+ type KW_CURRENT_ROLE = never;
1586
+
1587
+ type KW_SESSION_USER = never;
1588
+
1589
+ type KW_SYSTEM_USER = never;
1590
+
1591
+ type KW_GLOBAL = never;
1592
+
1593
+ type KW_SESSION = never;
1594
+
1595
+ type KW_LOCAL = never;
1596
+
1597
+ type KW_PERSIST = never;
1598
+
1599
+ type KW_PERSIST_ONLY = never;
1600
+
1601
+ type KW_VIEW = never;
1602
+
1603
+ type KW_VAR__PRE_AT = never;
1604
+
1605
+ type KW_VAR__PRE_AT_AT = never;
1606
+
1607
+ type KW_VAR_PRE_DOLLAR = never;
1608
+
1609
+ type KW_VAR_PRE_DOLLAR_DOUBLE = never;
1610
+
1611
+ type KW_VAR_PRE = never;
1612
+
1613
+ type KW_RETURN = never;
1614
+
1615
+ type KW_ASSIGN = never;
1616
+
1617
+ type KW_DOUBLE_COLON = never;
1618
+
1619
+ type KW_ASSIGIN_EQUAL = never;
1620
+
1621
+ type KW_DUAL = never;
1622
+
1623
+ type KW_ADD = never;
1624
+
1625
+ type KW_COLUMN = never;
1626
+
1627
+ type KW_INDEX = never;
1628
+
1629
+ type KW_KEY = never;
1630
+
1631
+ type KW_FULLTEXT = never;
1632
+
1633
+ type KW_SPATIAL = never;
1634
+
1635
+ type KW_UNIQUE = never;
1636
+
1637
+ type KW_KEY_BLOCK_SIZE = never;
1638
+
1639
+ type KW_COMMENT = never;
1640
+
1641
+ type KW_CONSTRAINT = never;
1642
+
1643
+ type KW_CONCURRENTLY = never;
1644
+
1645
+ type KW_REFERENCES = never;
1646
+
1647
+ export type OPT_SQL_CALC_FOUND_ROWS = "SQL_CALC_FOUND_ROWS";
1648
+
1649
+ export type OPT_SQL_CACHE = "SQL_CACHE";
1650
+
1651
+ export type OPT_SQL_NO_CACHE = "SQL_NO_CACHE";
1652
+
1653
+ export type OPT_SQL_SMALL_RESULT = "SQL_SMALL_RESULT";
1654
+
1655
+ export type OPT_SQL_BIG_RESULT = "SQL_BIG_RESULT";
1656
+
1657
+ export type OPT_SQL_BUFFER_RESULT = "SQL_BUFFER_RESULT";
1658
+
1659
+ export type DOT = ".";
1660
+
1661
+ export type COMMA = ",";
1662
+
1663
+ export type STAR = "*";
1664
+
1665
+ export type LPAREN = "(";
1666
+
1667
+ export type RPAREN = ")";
1668
+
1669
+ export type LBRAKE = "[";
1670
+
1671
+ export type RBRAKE = "]";
1672
+
1673
+ export type SEMICOLON = ";";
1674
+
1675
+ export type SINGLE_ARROW = "->";
1676
+
1677
+ export type DOUBLE_ARROW = "->>";
1678
+
1679
+ export type WELL_ARROW = "#>";
1680
+
1681
+ export type DOUBLE_WELL_ARROW = "#>>";
1682
+
1683
+ export type OPERATOR_CONCATENATION = "||";
1684
+
1685
+ export type OPERATOR_AND = "&&";
1686
+
1687
+ export type LOGIC_OPERATOR = OPERATOR_CONCATENATION | OPERATOR_AND;
1688
+
1689
+ export type __ = (whitespace | comment)[];
1690
+
1691
+ export type ___ = (whitespace | comment)[];
1692
+
1693
+ export type comment = block_comment | line_comment;
1694
+
1695
+ type block_comment = never;
1696
+
1697
+ type line_comment = never;
1698
+
1699
+ type pound_sign_comment = never;
1700
+
1701
+ export type keyword_comment = { type: 'comment'; keyword: 'comment'; symbol: '='; value: literal_string; };
1702
+
1703
+ type char = never;
1704
+
1705
+ export type interval_unit = KW_UNIT_YEAR | KW_UNIT_MONTH | KW_UNIT_DAY | KW_UNIT_HOUR | KW_UNIT_MINUTE | KW_UNIT_SECOND;
1706
+
1707
+ type whitespace = never;
1708
+
1709
+ type EOL = never;
1710
+
1711
+ type EOF = never;
1712
+
1713
+ export type proc_stmts = (proc_stmt)[];
1714
+
1715
+ export interface proc_stmt { type: 'proc'; stmt: assign_stmt | return_stmt; vars: any }
1716
+
1717
+ export type proc_stmt = AstStatement<proc_stmt>;
1718
+
1719
+ export type assign_stmt = { type: 'assign'; left: var_decl | without_prefix_var_decl; symbol: ':=' | '='; right: proc_expr; };
1720
+
1721
+ export type return_stmt = { type: 'return'; expr: proc_expr; };
1722
+
1723
+ export type proc_expr = select_stmt | proc_join | proc_additive_expr | proc_array;
1724
+
1725
+ export type proc_additive_expr = binary_expr;
1726
+
1727
+ export type proc_multiplicative_expr = binary_expr;
1728
+
1729
+ export type proc_join = { type: 'join'; ltable: var_decl; rtable: var_decl; op: join_op; expr: on_clause; };
1730
+
1731
+ 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
+
1733
+ export type proc_func_name = string;
1734
+
1735
+ export type proc_func_call = { type: 'function'; name: string; args: null | { type: expr_list; value: proc_primary_list; }};
1736
+
1737
+ export type proc_primary_list = proc_primary[];
1738
+
1739
+ export type proc_array = { type: 'array'; value: proc_primary_list };
1740
+
1741
+ export type var_decl_list = var_decl[];
1742
+
1743
+ export type var_decl = { type: 'var'; name: string; prefix: string; suffix: string; }; | without_prefix_var_decl & { type: 'var'; prefix: string; };;
1744
+
1745
+ export type without_prefix_var_decl = { type: 'var'; prefix: string; name: ident_name; members: mem_chain; quoted: string | null } | { type: 'var'; prefix: null; name: number; members: []; quoted: null };
1746
+
1747
+ export type mem_chain = ident_name[];;
1748
+
1749
+ export type data_type = {
1750
+ dataType: string;
1751
+ length?: number;
1752
+ suffix?: string;
1753
+ scale?: number;
1754
+ parentheses?: boolean;
1755
+ expr?: expr_list;
1756
+ };
1757
+
1758
+
1759
+
1760
+
1761
+
1762
+ export type array_type = data_type;
1763
+
1764
+
1765
+
1766
+ export type boolean_type = data_type;
1767
+
1768
+
1769
+
1770
+ export type binary_type = data_type;
1771
+
1772
+ export type character_varying = string;
1773
+
1774
+
1775
+
1776
+ export type character_string_type = data_type;
1777
+
1778
+ export type numeric_type_suffix = any[];;
1779
+
1780
+
1781
+
1782
+
1783
+
1784
+
1785
+
1786
+ export type numeric_type = data_type;
1787
+
1788
+
1789
+
1790
+ export type oid_type = data_type;
1791
+
1792
+ export type timezone = string[];;
1793
+
1794
+
1795
+
1796
+
1797
+
1798
+ export type time_type = data_type;
1799
+
1800
+
1801
+
1802
+
1803
+
1804
+ export type datetime_type = data_type | time_type;
1805
+
1806
+
1807
+
1808
+ export type enum_type = data_type;
1809
+
1810
+
1811
+
1812
+ export type json_type = data_type;
1813
+
1814
+
1815
+
1816
+ export type geometry_type = data_type;
1817
+
1818
+
1819
+
1820
+ export type serial_interval_type = data_type;
1821
+
1822
+
1823
+
1824
+
1825
+
1826
+ export type text_type = data_type;
1827
+
1828
+
1829
+
1830
+ export type uuid_type = data_type;
1831
+
1832
+
1833
+
1834
+ export type record_type = data_type;