kaqing 2.0.56__py3-none-any.whl → 2.0.57__py3-none-any.whl
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.
- adam/sql/sql_completer.py +370 -231
- adam/version.py +1 -1
- {kaqing-2.0.56.dist-info → kaqing-2.0.57.dist-info}/METADATA +1 -1
- {kaqing-2.0.56.dist-info → kaqing-2.0.57.dist-info}/RECORD +7 -7
- {kaqing-2.0.56.dist-info → kaqing-2.0.57.dist-info}/WHEEL +0 -0
- {kaqing-2.0.56.dist-info → kaqing-2.0.57.dist-info}/entry_points.txt +0 -0
- {kaqing-2.0.56.dist-info → kaqing-2.0.57.dist-info}/top_level.txt +0 -0
adam/sql/sql_completer.py
CHANGED
@@ -10,7 +10,128 @@ from adam.sql.term_completer import TermCompleter
|
|
10
10
|
columns = TermCompleter(['id', 'x.', 'y.', 'z.'])
|
11
11
|
|
12
12
|
class SqlCompleter(Completer):
|
13
|
+
# <select_statement> ::= SELECT <select_list>
|
14
|
+
# FROM <table_expression>
|
15
|
+
# [WHERE <search_condition>]
|
16
|
+
# [<group_by_clause>]
|
17
|
+
# [<having_clause>]
|
18
|
+
# [<order_by_clause>]
|
19
|
+
# [<limit_clause>]
|
13
20
|
|
21
|
+
# <search_condition> ::= <boolean_term>
|
22
|
+
# | <search_condition> OR <boolean_term>
|
23
|
+
|
24
|
+
# <boolean_term> ::= <boolean_factor>
|
25
|
+
# | <boolean_term> AND <boolean_factor>
|
26
|
+
|
27
|
+
# <boolean_factor> ::= [NOT] <predicate>
|
28
|
+
# | ([NOT] <search_condition>)
|
29
|
+
|
30
|
+
# <predicate> ::= <comparison_predicate>
|
31
|
+
# | <between_predicate>
|
32
|
+
# | <in_predicate>
|
33
|
+
# | <like_predicate>
|
34
|
+
# | <null_predicate>
|
35
|
+
# | <exists_predicate>
|
36
|
+
# | <quantified_predicate>
|
37
|
+
# | <unique_predicate>
|
38
|
+
# | <match_predicate>
|
39
|
+
# | <overlaps_predicate>
|
40
|
+
# | <distinct_predicate>
|
41
|
+
# | <member_predicate>
|
42
|
+
# | <submultiset_predicate>
|
43
|
+
# | <set_predicate>
|
44
|
+
|
45
|
+
# <comparison_predicate> ::= <row_value_expression> <comparison_operator> <row_value_expression>
|
46
|
+
# <comparison_operator> ::= '=' | '<>' | '<' | '<=' | '>' | '>='
|
47
|
+
|
48
|
+
# <row_value_expression> ::= <value_expression>
|
49
|
+
# | (<value_expression> [ { <comma> <value_expression> }... ])
|
50
|
+
|
51
|
+
# <value_expression> ::= <numeric_value_expression>
|
52
|
+
# | <string_value_expression>
|
53
|
+
# | <datetime_value_expression>
|
54
|
+
# | <interval_value_expression>
|
55
|
+
# | <boolean_value_expression>
|
56
|
+
# | <user_defined_type_value_expression>
|
57
|
+
# | <reference_value_expression>
|
58
|
+
# | <collection_value_expression>
|
59
|
+
# | <row_value_constructor>
|
60
|
+
# | <case_expression>
|
61
|
+
# | <cast_expression>
|
62
|
+
# | <subquery>
|
63
|
+
# | NULL
|
64
|
+
# | DEFAULT
|
65
|
+
# | <identifier>
|
66
|
+
# | <literal>
|
67
|
+
|
68
|
+
# <insert_statement> ::= INSERT INTO <table_name> [ ( <column_list> ) ]
|
69
|
+
# VALUES ( <value_list> )
|
70
|
+
# | INSERT INTO <table_name> [ ( <column_list> ) ]
|
71
|
+
# <query_expression>
|
72
|
+
|
73
|
+
# <table_name> ::= <identifier>
|
74
|
+
|
75
|
+
# <column_list> ::= <column_name> [ , <column_list> ]
|
76
|
+
|
77
|
+
# <column_name> ::= <identifier>
|
78
|
+
|
79
|
+
# <value_list> ::= <expression> [ , <value_list> ]
|
80
|
+
|
81
|
+
# <query_expression> ::= SELECT <select_list> FROM <table_reference_list> [ WHERE <search_condition> ] [ GROUP BY <grouping_column_list> ] [ HAVING <search_condition> ] [ ORDER BY <sort_specification_list> ]
|
82
|
+
|
83
|
+
# <update_statement> ::= UPDATE <table_name>
|
84
|
+
# SET <set_clause_list>
|
85
|
+
# [WHERE <search_condition>]
|
86
|
+
|
87
|
+
# <set_clause_list> ::= <set_clause> { , <set_clause> }
|
88
|
+
|
89
|
+
# <set_clause> ::= <column_name> = <update_value>
|
90
|
+
|
91
|
+
# <update_value> ::= <expression> | NULL | DEFAULT
|
92
|
+
|
93
|
+
# <search_condition> ::= <boolean_expression>
|
94
|
+
|
95
|
+
# <delete_statement> ::= DELETE FROM <table_name> [ WHERE <search_condition> ]
|
96
|
+
|
97
|
+
# <table_name> ::= <identifier>
|
98
|
+
|
99
|
+
# <search_condition> ::= <boolean_expression>
|
100
|
+
|
101
|
+
# <boolean_expression> ::= <predicate>
|
102
|
+
# | <boolean_expression> AND <predicate>
|
103
|
+
# | <boolean_expression> OR <predicate>
|
104
|
+
# | NOT <predicate>
|
105
|
+
# | ( <boolean_expression> )
|
106
|
+
|
107
|
+
# <predicate> ::= <expression> <comparison_operator> <expression>
|
108
|
+
# | <expression> IS NULL
|
109
|
+
# | <expression> IS NOT NULL
|
110
|
+
# | <expression> LIKE <pattern> [ ESCAPE <escape_character> ]
|
111
|
+
# | <expression> IN ( <expression_list> )
|
112
|
+
# | EXISTS ( <select_statement> )
|
113
|
+
# | ... (other predicates)
|
114
|
+
|
115
|
+
# <comparison_operator> ::= = | <> | != | > | < | >= | <=
|
116
|
+
|
117
|
+
# <expression> ::= <literal>
|
118
|
+
# | <column_name>
|
119
|
+
# | <function_call>
|
120
|
+
# | ( <expression> )
|
121
|
+
# | <expression> <arithmetic_operator> <expression>
|
122
|
+
# | ... (other expressions)
|
123
|
+
|
124
|
+
# <literal> ::= <numeric_literal> | <string_literal> | <boolean_literal> | <date_literal> | ...
|
125
|
+
|
126
|
+
# <column_name> ::= <identifier>
|
127
|
+
|
128
|
+
# <identifier> ::= <letter> { <letter> | <digit> | _ }...
|
129
|
+
|
130
|
+
# <pattern> ::= <string_literal>
|
131
|
+
|
132
|
+
# <escape_character> ::= <string_literal> (single character)
|
133
|
+
|
134
|
+
# <expression_list> ::= <expression> { , <expression> }...
|
14
135
|
def __init__(self, tables: Callable[[], list[str]], dml: str = None, debug = False):
|
15
136
|
super().__init__()
|
16
137
|
self.dml = dml
|
@@ -45,65 +166,67 @@ class SqlCompleter(Completer):
|
|
45
166
|
completer = TermCompleter(['*'])
|
46
167
|
elif state == 'select_a_':
|
47
168
|
completer = TermCompleter(['from'])
|
48
|
-
elif state == "
|
169
|
+
elif state == "select_from_":
|
49
170
|
completer = TermCompleter(self.tables())
|
50
|
-
elif state == "
|
171
|
+
elif state == "select_from_x_":
|
51
172
|
completer = TermCompleter(['as', 'where', 'inner', 'left', 'right', 'full', 'group', 'limit'])
|
52
|
-
elif state == "
|
173
|
+
elif state == "select_from_x_as_x_":
|
53
174
|
completer = TermCompleter(['where', 'inner', 'left', 'right', 'full', 'group', 'limit'])
|
54
|
-
elif state == "
|
175
|
+
elif state == "select_from_x,":
|
55
176
|
completer = TermCompleter(self.tables())
|
56
|
-
elif state == "
|
177
|
+
elif state == "select_from_x_as_":
|
57
178
|
completer = TermCompleter(['x', 'y', 'z'])
|
58
|
-
elif state == "
|
179
|
+
elif state == "select_from_x_as_x,":
|
59
180
|
completer = TermCompleter(self.tables())
|
60
|
-
elif state == "
|
181
|
+
elif state == "select_where_":
|
61
182
|
completer = columns
|
62
|
-
elif state
|
63
|
-
completer = TermCompleter(['=', '<', '<=', '>', '>=', '<>', 'like'])
|
64
|
-
elif state == "
|
183
|
+
elif state in ["select_where_a", "select_where_a_"]:
|
184
|
+
completer = TermCompleter(['=', '<', '<=', '>', '>=', '<>', 'like', 'not'])
|
185
|
+
elif state == "select_where_a_not_":
|
186
|
+
completer = TermCompleter(['like', 'in'])
|
187
|
+
elif state == "select_where_a_op":
|
65
188
|
completer = TermCompleter(["'"])
|
66
|
-
elif state == "
|
189
|
+
elif state == "select_where_sc_":
|
67
190
|
completer = TermCompleter(['and', 'or', 'group', 'limit'])
|
68
|
-
elif state == "
|
191
|
+
elif state == "select_where_sc_limit_":
|
69
192
|
completer = TermCompleter(['1'])
|
70
|
-
elif state == "
|
193
|
+
elif state == "select_from_x_group_":
|
71
194
|
completer = TermCompleter(['by'])
|
72
|
-
elif state == "
|
195
|
+
elif state == "select_from_x_group_by_":
|
73
196
|
completer = columns
|
74
|
-
elif state == "
|
197
|
+
elif state == "select_from_x_group_by_a,":
|
75
198
|
completer = columns
|
76
|
-
elif state == "
|
199
|
+
elif state == "select_from_x_group_by_a_":
|
77
200
|
completer = TermCompleter(['limit'])
|
78
|
-
elif state == "
|
201
|
+
elif state == "select_from_x_group_by_a_limit_":
|
79
202
|
completer = TermCompleter(['1'])
|
80
|
-
elif state == "
|
203
|
+
elif state == "select_from_x_inner_":
|
81
204
|
completer = TermCompleter(['join'])
|
82
|
-
elif state in ["
|
205
|
+
elif state in ["select_join_", "select_from_x_left_join_"]:
|
83
206
|
completer = TermCompleter(self.tables())
|
84
|
-
elif state == "
|
207
|
+
elif state == "select_x_join_y,":
|
85
208
|
completer = TermCompleter(self.tables())
|
86
|
-
elif state == "
|
209
|
+
elif state == "select_x_join_y_":
|
87
210
|
completer = TermCompleter(['on'])
|
88
|
-
elif state == "
|
211
|
+
elif state == "select_x_join_y_on_":
|
89
212
|
completer = columns
|
90
|
-
elif state == "
|
213
|
+
elif state == "select_x_join_y_on_a":
|
91
214
|
completer = TermCompleter(['='])
|
92
|
-
elif state == "
|
215
|
+
elif state == "select_x_join_y_on_a_op":
|
93
216
|
completer = columns
|
94
|
-
elif state == "
|
217
|
+
elif state == "select_x_join_y_on_a_opb_":
|
95
218
|
completer = TermCompleter(['where', 'group', 'limit'])
|
96
|
-
elif state == "
|
219
|
+
elif state == "select_from_x_left_":
|
97
220
|
completer = TermCompleter(['outer', 'join'])
|
98
|
-
elif state == "
|
221
|
+
elif state == "select_from_x_left_outer_":
|
99
222
|
completer = TermCompleter(['join'])
|
100
|
-
elif state == "
|
223
|
+
elif state == "select_from_x_right_":
|
101
224
|
completer = TermCompleter(['outer', 'join'])
|
102
|
-
elif state == "
|
225
|
+
elif state == "select_from_x_right_outer_":
|
103
226
|
completer = TermCompleter(['join'])
|
104
|
-
elif state == "
|
227
|
+
elif state == "select_from_x_full_":
|
105
228
|
completer = TermCompleter(['outer'])
|
106
|
-
elif state == "
|
229
|
+
elif state == "select_from_x_full_outer_":
|
107
230
|
completer = TermCompleter(['join'])
|
108
231
|
|
109
232
|
elif state == "insert_":
|
@@ -111,35 +234,35 @@ class SqlCompleter(Completer):
|
|
111
234
|
elif state == "insert_into_":
|
112
235
|
completer = TermCompleter(self.tables())
|
113
236
|
elif state == "insert_into_x_":
|
114
|
-
completer = TermCompleter(['values'])
|
115
|
-
elif state == "
|
237
|
+
completer = TermCompleter(['values(', 'select'])
|
238
|
+
elif state == "insert_into_x_lp_":
|
116
239
|
completer = columns
|
117
|
-
elif state == "
|
240
|
+
elif state == "insert_into_x_lp_a,":
|
118
241
|
completer = columns
|
119
|
-
elif state == "
|
120
|
-
completer = TermCompleter(['values('])
|
121
|
-
elif state == "
|
242
|
+
elif state == "insert_into_x_lp_a_rp_":
|
243
|
+
completer = TermCompleter(['values(', 'select'])
|
244
|
+
elif state == "insert_values":
|
122
245
|
completer = TermCompleter(['('])
|
123
|
-
elif state == "
|
246
|
+
elif state == "insert_values_lp_":
|
124
247
|
completer = TermCompleter(["'"])
|
125
248
|
|
126
249
|
elif state == "update_":
|
127
250
|
completer = TermCompleter(self.tables())
|
128
251
|
elif state == "update_x_":
|
129
252
|
completer = TermCompleter(['set'])
|
130
|
-
elif state in ["update_x_set_", "
|
253
|
+
elif state in ["update_x_set_", "update_x_set_sc,"]:
|
131
254
|
completer = columns
|
132
255
|
elif state == "update_x_set_a":
|
133
256
|
completer = TermCompleter(['='])
|
134
|
-
elif state == "
|
257
|
+
elif state == "update_x_set_a_op":
|
135
258
|
completer = TermCompleter(["'"])
|
136
|
-
elif state == "
|
259
|
+
elif state == "update_x_set_sc_":
|
137
260
|
completer = TermCompleter(['where'])
|
138
|
-
elif state == "
|
261
|
+
elif state == "update_where_":
|
139
262
|
completer = columns
|
140
|
-
elif state == "
|
263
|
+
elif state == "update_where_a":
|
141
264
|
completer = TermCompleter(['='])
|
142
|
-
elif state == "
|
265
|
+
elif state == "update_where_sc_":
|
143
266
|
completer = TermCompleter(['and', 'or'])
|
144
267
|
|
145
268
|
elif state == "delete_":
|
@@ -148,13 +271,13 @@ class SqlCompleter(Completer):
|
|
148
271
|
completer = TermCompleter(self.tables())
|
149
272
|
elif state == "delete_from_x_":
|
150
273
|
completer = TermCompleter(['where'])
|
151
|
-
elif state == "
|
274
|
+
elif state == "delete_where_":
|
152
275
|
completer = columns
|
153
|
-
elif state == "
|
276
|
+
elif state == "delete_where_a":
|
154
277
|
completer = TermCompleter(['='])
|
155
|
-
elif state == "
|
278
|
+
elif state == "delete_where_a_op":
|
156
279
|
completer = TermCompleter(["'"])
|
157
|
-
elif state == "
|
280
|
+
elif state == "delete_where_sc_":
|
158
281
|
completer = TermCompleter(['and', 'or'])
|
159
282
|
|
160
283
|
if completer:
|
@@ -209,209 +332,225 @@ class SqlCompleter(Completer):
|
|
209
332
|
state = 'select_a'
|
210
333
|
elif state == 'select_a_':
|
211
334
|
if token.ttype == T.Keyword and token.value.lower() == 'from':
|
212
|
-
state = '
|
213
|
-
elif state == '
|
335
|
+
state = 'select_from'
|
336
|
+
elif state == 'select_from':
|
214
337
|
if token.ttype == T.Text.Whitespace:
|
215
|
-
state = '
|
216
|
-
elif state == '
|
338
|
+
state = 'select_from_'
|
339
|
+
elif state == 'select_from_':
|
217
340
|
if token.ttype == T.Name:
|
218
|
-
state = '
|
219
|
-
elif state == '
|
341
|
+
state = 'select_from_x'
|
342
|
+
elif state == 'select_from_x':
|
220
343
|
if token.ttype == T.Text.Whitespace:
|
221
|
-
state = '
|
344
|
+
state = 'select_from_x_'
|
222
345
|
elif token.ttype == T.Punctuation and token.value == ',':
|
223
|
-
state = '
|
224
|
-
elif state == '
|
346
|
+
state = 'select_from_x,'
|
347
|
+
elif state == 'select_from_x,':
|
225
348
|
if token.ttype == T.Name:
|
226
|
-
state = '
|
227
|
-
elif state in ['
|
349
|
+
state = 'select_from_x'
|
350
|
+
elif state in ['select_from_x_', 'select_from_x_as_x_']:
|
228
351
|
if token.ttype == T.Punctuation and token.value == ',':
|
229
|
-
state = '
|
352
|
+
state = 'select_from_x,'
|
230
353
|
elif token.ttype == T.Keyword and token.value.lower() == 'as':
|
231
|
-
state = '
|
354
|
+
state = 'select_from_x_as'
|
232
355
|
elif token.ttype == T.Keyword and token.value.lower() == 'where':
|
233
|
-
state = '
|
356
|
+
state = 'select_where'
|
234
357
|
elif token.ttype == T.Keyword and token.value.lower() == 'limit':
|
235
|
-
state = '
|
358
|
+
state = 'select_where_sc_limit'
|
236
359
|
elif token.ttype == T.Keyword and token.value.lower() == 'group':
|
237
|
-
state = '
|
360
|
+
state = 'select_from_x_group'
|
238
361
|
elif token.ttype == T.Keyword and token.value.lower() == 'group by':
|
239
|
-
state = '
|
362
|
+
state = 'select_from_x_group_by'
|
240
363
|
elif token.ttype == T.Keyword and token.value.lower() == 'inner':
|
241
|
-
state = '
|
364
|
+
state = 'select_from_x_inner'
|
242
365
|
elif token.ttype == T.Keyword and token.value.lower() == 'inner join':
|
243
|
-
state = '
|
366
|
+
state = 'select_join'
|
244
367
|
elif token.ttype == T.Keyword and token.value.lower() == 'left':
|
245
|
-
state = '
|
368
|
+
state = 'select_from_x_left'
|
246
369
|
elif token.ttype == T.Keyword and token.value.lower() in ['left join', 'left outer join']:
|
247
|
-
state = '
|
370
|
+
state = 'select_join'
|
248
371
|
elif token.ttype == T.Keyword and token.value.lower() == 'right':
|
249
|
-
state = '
|
372
|
+
state = 'select_from_x_right'
|
250
373
|
elif token.ttype == T.Keyword and token.value.lower() in ['right join', 'right outer join']:
|
251
|
-
state = '
|
374
|
+
state = 'select_join'
|
252
375
|
elif token.ttype == T.Keyword and token.value.lower() == 'full':
|
253
|
-
state = '
|
376
|
+
state = 'select_from_x_full'
|
254
377
|
elif token.ttype == T.Keyword and token.value.lower() == 'full outer join':
|
255
|
-
state = '
|
256
|
-
elif state == '
|
378
|
+
state = 'select_join'
|
379
|
+
elif state == 'select_from_x_as':
|
257
380
|
if token.ttype == T.Text.Whitespace:
|
258
|
-
state = '
|
259
|
-
elif state == '
|
381
|
+
state = 'select_from_x_as_'
|
382
|
+
elif state == 'select_from_x_as_':
|
260
383
|
if token.ttype == T.Name:
|
261
|
-
state = '
|
262
|
-
elif state == '
|
384
|
+
state = 'select_from_x_as_x'
|
385
|
+
elif state == 'select_from_x_as_x':
|
263
386
|
if token.ttype == T.Text.Whitespace:
|
264
|
-
state = '
|
387
|
+
state = 'select_from_x_as_x_'
|
265
388
|
elif token.ttype == T.Punctuation and token.value == ',':
|
266
|
-
state = '
|
267
|
-
elif state == '
|
389
|
+
state = 'select_from_x_as_x,'
|
390
|
+
elif state == 'select_from_x_as_x,':
|
268
391
|
if token.ttype == T.Name:
|
269
|
-
state = '
|
270
|
-
elif state == '
|
392
|
+
state = 'select_from_x'
|
393
|
+
elif state == 'select_where':
|
271
394
|
if token.ttype == T.Text.Whitespace:
|
272
|
-
state = '
|
273
|
-
elif state == '
|
395
|
+
state = 'select_where_'
|
396
|
+
elif state == 'select_where_':
|
274
397
|
if token.ttype == T.Name:
|
275
|
-
state = '
|
276
|
-
elif state == '
|
398
|
+
state = 'select_where_a'
|
399
|
+
elif state == 'select_where_a':
|
400
|
+
if token.ttype == T.Text.Whitespace:
|
401
|
+
state = 'select_where_a_'
|
402
|
+
elif token.ttype == T.Operator.Comparison:
|
403
|
+
state = 'select_where_a_op'
|
404
|
+
elif state == 'select_where_a_':
|
277
405
|
if token.ttype == T.Operator.Comparison:
|
278
|
-
state = '
|
279
|
-
|
406
|
+
state = 'select_where_a_op'
|
407
|
+
elif token.ttype == T.Keyword and token.value.lower() == 'not':
|
408
|
+
state = 'select_where_a_not'
|
409
|
+
elif state == 'select_where_a_not':
|
410
|
+
if token.ttype == T.Text.Whitespace:
|
411
|
+
state = 'select_where_a_not_'
|
412
|
+
elif state == 'select_where_a_not_':
|
413
|
+
if token.ttype == T.Operator.Comparison:
|
414
|
+
state = 'select_where_a_not_op'
|
415
|
+
elif state == 'select_where_a_not_op':
|
416
|
+
if token.ttype in [T.Literal.String.Single, T.Name]:
|
417
|
+
state = 'select_where_sc'
|
418
|
+
elif state == 'select_where_a_op':
|
280
419
|
if token.ttype in [T.Literal.String.Single, T.Name]:
|
281
|
-
state = '
|
282
|
-
elif state == '
|
420
|
+
state = 'select_where_sc'
|
421
|
+
elif state == 'select_where_sc':
|
283
422
|
if token.ttype == T.Text.Whitespace:
|
284
|
-
state = '
|
285
|
-
elif state == '
|
423
|
+
state = 'select_where_sc_'
|
424
|
+
elif state == 'select_where_sc_':
|
286
425
|
if token.ttype == T.Keyword and token.value.lower() in ['and', 'or']:
|
287
|
-
state = '
|
426
|
+
state = 'select_where'
|
288
427
|
elif token.ttype == T.Keyword and token.value.lower() == 'group':
|
289
|
-
state = '
|
428
|
+
state = 'select_from_x_group'
|
290
429
|
elif token.ttype == T.Keyword and token.value.lower() == 'group by':
|
291
|
-
state = '
|
430
|
+
state = 'select_from_x_group_by'
|
292
431
|
elif token.ttype == T.Keyword and token.value.lower() == 'limit':
|
293
|
-
state = '
|
294
|
-
elif state == '
|
432
|
+
state = 'select_where_sc_limit'
|
433
|
+
elif state == 'select_from_x_group':
|
295
434
|
if token.ttype == T.Text.Whitespace:
|
296
|
-
state = '
|
297
|
-
elif state == '
|
435
|
+
state = 'select_from_x_group_'
|
436
|
+
elif state == 'select_from_x_group_':
|
298
437
|
if token.ttype == T.Keyword and token.value.lower() == 'by':
|
299
|
-
state = '
|
300
|
-
elif state == '
|
438
|
+
state = 'select_from_x_group_by'
|
439
|
+
elif state == 'select_from_x_group_by':
|
301
440
|
if token.ttype == T.Text.Whitespace:
|
302
|
-
state = '
|
303
|
-
elif state == '
|
441
|
+
state = 'select_from_x_group_by_'
|
442
|
+
elif state == 'select_from_x_group_by_':
|
304
443
|
if token.ttype == T.Name:
|
305
|
-
state = '
|
306
|
-
elif state == '
|
444
|
+
state = 'select_from_x_group_by_a'
|
445
|
+
elif state == 'select_from_x_group_by_a':
|
307
446
|
if token.ttype == T.Text.Whitespace:
|
308
|
-
state = '
|
447
|
+
state = 'select_from_x_group_by_a_'
|
309
448
|
elif token.ttype == T.Punctuation and token.value == ',':
|
310
|
-
state = '
|
311
|
-
elif state == '
|
449
|
+
state = 'select_from_x_group_by_a,'
|
450
|
+
elif state == 'select_from_x_group_by_a,':
|
312
451
|
if token.ttype == T.Name:
|
313
|
-
state = '
|
314
|
-
elif state == '
|
452
|
+
state = 'select_from_x_group_by_a'
|
453
|
+
elif state == 'select_from_x_group_by_a_':
|
315
454
|
if token.ttype == T.Keyword and token.value.lower() == 'limit':
|
316
|
-
state = '
|
317
|
-
elif state == '
|
455
|
+
state = 'select_where_sc_limit'
|
456
|
+
elif state == 'select_where_sc_limit':
|
318
457
|
if token.ttype == T.Text.Whitespace:
|
319
|
-
state = '
|
320
|
-
elif state == '
|
458
|
+
state = 'select_where_sc_limit_'
|
459
|
+
elif state == 'select_from_x_inner':
|
321
460
|
if token.ttype == T.Text.Whitespace:
|
322
|
-
state = '
|
323
|
-
elif state == '
|
461
|
+
state = 'select_from_x_inner_'
|
462
|
+
elif state == 'select_from_x_inner_':
|
324
463
|
if token.ttype == T.Keyword and token.value.lower() == 'join':
|
325
|
-
state = '
|
326
|
-
elif state == '
|
464
|
+
state = 'select_join'
|
465
|
+
elif state == 'select_join':
|
327
466
|
if token.ttype == T.Text.Whitespace:
|
328
|
-
state = '
|
329
|
-
elif state == '
|
467
|
+
state = 'select_join_'
|
468
|
+
elif state == 'select_join_':
|
330
469
|
if token.ttype == T.Name:
|
331
|
-
state = '
|
470
|
+
state = 'select_x_join_y'
|
332
471
|
|
333
|
-
elif state == '
|
472
|
+
elif state == 'select_from_x_left':
|
334
473
|
if token.ttype == T.Text.Whitespace:
|
335
|
-
state = '
|
336
|
-
elif state == '
|
474
|
+
state = 'select_from_x_left_'
|
475
|
+
elif state == 'select_from_x_left_':
|
337
476
|
if token.ttype == T.Keyword and token.value.lower() == 'join':
|
338
|
-
state = '
|
477
|
+
state = 'select_join'
|
339
478
|
elif token.ttype == T.Keyword and token.value.lower() == 'outer':
|
340
|
-
state = '
|
341
|
-
elif state == '
|
479
|
+
state = 'select_from_x_left_outer'
|
480
|
+
elif state == 'select_from_x_left_outer':
|
342
481
|
if token.ttype == T.Text.Whitespace:
|
343
|
-
state = '
|
344
|
-
elif state == '
|
482
|
+
state = 'select_from_x_left_outer_'
|
483
|
+
elif state == 'select_from_x_left_outer_':
|
345
484
|
if token.ttype == T.Keyword and token.value.lower() == 'join':
|
346
|
-
state = '
|
485
|
+
state = 'select_join_'
|
347
486
|
|
348
|
-
elif state == '
|
487
|
+
elif state == 'select_from_x_right':
|
349
488
|
if token.ttype == T.Text.Whitespace:
|
350
|
-
state = '
|
351
|
-
elif state == '
|
489
|
+
state = 'select_from_x_right_'
|
490
|
+
elif state == 'select_from_x_right_':
|
352
491
|
if token.ttype == T.Keyword and token.value.lower() == 'join':
|
353
|
-
state = '
|
492
|
+
state = 'select_join'
|
354
493
|
elif token.ttype == T.Keyword and token.value.lower() == 'outer':
|
355
|
-
state = '
|
356
|
-
elif state == '
|
494
|
+
state = 'select_from_x_right_outer'
|
495
|
+
elif state == 'select_from_x_right_outer':
|
357
496
|
if token.ttype == T.Text.Whitespace:
|
358
|
-
state = '
|
359
|
-
elif state == '
|
497
|
+
state = 'select_from_x_right_outer_'
|
498
|
+
elif state == 'select_from_x_right_outer_':
|
360
499
|
if token.ttype == T.Keyword and token.value.lower() == 'join':
|
361
|
-
state = '
|
500
|
+
state = 'select_join_'
|
362
501
|
|
363
|
-
elif state == '
|
502
|
+
elif state == 'select_from_x_full':
|
364
503
|
if token.ttype == T.Text.Whitespace:
|
365
|
-
state = '
|
366
|
-
elif state == '
|
504
|
+
state = 'select_from_x_full_'
|
505
|
+
elif state == 'select_from_x_full_':
|
367
506
|
if token.ttype == T.Keyword and token.value.lower() == 'outer':
|
368
|
-
state = '
|
369
|
-
elif state == '
|
507
|
+
state = 'select_from_x_full_outer'
|
508
|
+
elif state == 'select_from_x_full_outer':
|
370
509
|
if token.ttype == T.Text.Whitespace:
|
371
|
-
state = '
|
372
|
-
elif state == '
|
510
|
+
state = 'select_from_x_full_outer_'
|
511
|
+
elif state == 'select_from_x_full_outer_':
|
373
512
|
if token.ttype == T.Keyword and token.value.lower() == 'join':
|
374
|
-
state = '
|
513
|
+
state = 'select_join_'
|
375
514
|
|
376
|
-
elif state == '
|
515
|
+
elif state == 'select_x_join_y':
|
377
516
|
if token.ttype == T.Punctuation and token.value == ',':
|
378
|
-
state = '
|
517
|
+
state = 'select_x_join_y,'
|
379
518
|
elif token.ttype == T.Text.Whitespace:
|
380
|
-
state = '
|
381
|
-
elif state == '
|
519
|
+
state = 'select_x_join_y_'
|
520
|
+
elif state == 'select_x_join_y,':
|
382
521
|
if token.ttype == T.Name:
|
383
|
-
state = '
|
384
|
-
elif state == '
|
522
|
+
state = 'select_x_join_y'
|
523
|
+
elif state == 'select_x_join_y_':
|
385
524
|
if token.ttype == T.Keyword and token.value.lower() == 'on':
|
386
|
-
state = '
|
387
|
-
elif state == '
|
525
|
+
state = 'select_x_join_y_on'
|
526
|
+
elif state == 'select_x_join_y_on':
|
388
527
|
if token.ttype == T.Text.Whitespace:
|
389
|
-
state = '
|
390
|
-
elif state == '
|
528
|
+
state = 'select_x_join_y_on_'
|
529
|
+
elif state == 'select_x_join_y_on_':
|
391
530
|
if token.ttype == T.Name:
|
392
|
-
state = '
|
393
|
-
elif state == '
|
531
|
+
state = 'select_x_join_y_on_a'
|
532
|
+
elif state == 'select_x_join_y_on_a':
|
394
533
|
if token.ttype == T.Operator.Comparison:
|
395
|
-
state = '
|
396
|
-
elif state == '
|
534
|
+
state = 'select_x_join_y_on_a_op'
|
535
|
+
elif state == 'select_x_join_y_on_a_op':
|
397
536
|
if token.ttype in [T.Literal.String.Single, T.Name]:
|
398
|
-
state = '
|
399
|
-
elif state == '
|
537
|
+
state = 'select_x_join_y_on_a_opb'
|
538
|
+
elif state == 'select_x_join_y_on_a_opb':
|
400
539
|
if token.ttype == T.Text.Whitespace:
|
401
|
-
state = '
|
540
|
+
state = 'select_x_join_y_on_a_opb_'
|
402
541
|
elif token.ttype == T.Punctuation and token.value == ',':
|
403
|
-
state = '
|
404
|
-
elif state == '
|
542
|
+
state = 'select_x_join_y_on_'
|
543
|
+
elif state == 'select_x_join_y_on_a_opb_':
|
405
544
|
if token.ttype == T.Keyword and token.value.lower() in ['and', 'or']:
|
406
|
-
state = '
|
545
|
+
state = 'select_join'
|
407
546
|
elif token.ttype == T.Keyword and token.value.lower() == 'where':
|
408
|
-
state = '
|
547
|
+
state = 'select_where'
|
409
548
|
elif token.ttype == T.Keyword and token.value.lower() == 'group':
|
410
|
-
state = '
|
549
|
+
state = 'select_from_x_group'
|
411
550
|
elif token.ttype == T.Keyword and token.value.lower() == 'group by':
|
412
|
-
state = '
|
551
|
+
state = 'select_from_x_group_by'
|
413
552
|
elif token.ttype == T.Keyword and token.value.lower() == 'limit':
|
414
|
-
state = '
|
553
|
+
state = 'select_where_sc_limit'
|
415
554
|
|
416
555
|
elif state == 'insert':
|
417
556
|
if token.ttype == T.Text.Whitespace:
|
@@ -429,43 +568,43 @@ class SqlCompleter(Completer):
|
|
429
568
|
if token.ttype == T.Text.Whitespace:
|
430
569
|
state = 'insert_into_x_'
|
431
570
|
elif token.ttype == T.Punctuation and token.value == '(':
|
432
|
-
state = '
|
571
|
+
state = 'insert_into_x_lp_'
|
433
572
|
elif state == 'insert_into_x_':
|
434
573
|
if token.ttype == T.Punctuation and token.value == '(':
|
435
|
-
state = '
|
574
|
+
state = 'insert_into_x_lp_'
|
436
575
|
elif token.ttype == T.Keyword and token.value.lower() == 'values':
|
437
|
-
state = '
|
438
|
-
elif state == '
|
576
|
+
state = 'insert_values'
|
577
|
+
elif state == 'insert_into_x_lp_':
|
439
578
|
if token.ttype == T.Name:
|
440
|
-
state = '
|
441
|
-
elif state == '
|
579
|
+
state = 'insert_into_x_lp_a'
|
580
|
+
elif state == 'insert_into_x_lp_a':
|
442
581
|
if token.ttype == T.Punctuation and token.value == ',':
|
443
|
-
state = '
|
582
|
+
state = 'insert_into_x_lp_a,'
|
444
583
|
elif token.ttype == T.Punctuation and token.value == ')':
|
445
|
-
state = '
|
446
|
-
elif state == '
|
584
|
+
state = 'insert_into_x_lp_a_rp'
|
585
|
+
elif state == 'insert_into_x_lp_a,':
|
447
586
|
if token.ttype == T.Name:
|
448
|
-
state = '
|
449
|
-
elif state == '
|
587
|
+
state = 'insert_into_x_lp_a'
|
588
|
+
elif state == 'insert_into_x_lp_a_rp':
|
450
589
|
if token.ttype == T.Text.Whitespace:
|
451
|
-
state = '
|
452
|
-
elif state == '
|
590
|
+
state = 'insert_into_x_lp_a_rp_'
|
591
|
+
elif state == 'insert_into_x_lp_a_rp_':
|
453
592
|
if token.ttype == T.Keyword and token.value.lower() == 'values':
|
454
|
-
state = '
|
455
|
-
|
593
|
+
state = 'insert_values'
|
594
|
+
elif token.ttype == T.Keyword.DML and token.value.lower() == 'select':
|
595
|
+
state = 'select_'
|
596
|
+
elif state == 'insert_values':
|
456
597
|
if token.ttype == T.Punctuation and token.value == '(':
|
457
|
-
state = '
|
458
|
-
elif state == '
|
598
|
+
state = 'insert_values_lp_'
|
599
|
+
elif state == 'insert_values_lp_':
|
459
600
|
if token.ttype in [T.Literal.String.Single, T.Name]:
|
460
|
-
state = '
|
461
|
-
elif state == '
|
601
|
+
state = 'insert_values_lp_v'
|
602
|
+
elif state == 'insert_values_lp_v':
|
462
603
|
if token.ttype == T.Punctuation and token.value == ',':
|
463
|
-
state = '
|
464
|
-
|
465
|
-
state = 'insert_into_x_values(v)'
|
466
|
-
elif state == 'insert_into_x_values(v,':
|
604
|
+
state = 'insert_values_lp_v,'
|
605
|
+
elif state == 'insert_values_lp_v,':
|
467
606
|
if token.ttype in [T.Literal.String.Single, T.Name]:
|
468
|
-
state = '
|
607
|
+
state = 'insert_values_lp_v'
|
469
608
|
|
470
609
|
elif state == 'update':
|
471
610
|
if token.ttype == T.Text.Whitespace:
|
@@ -487,41 +626,41 @@ class SqlCompleter(Completer):
|
|
487
626
|
state = 'update_x_set_a'
|
488
627
|
elif state == 'update_x_set_a':
|
489
628
|
if token.ttype == T.Operator.Comparison:
|
490
|
-
state = '
|
491
|
-
elif state == '
|
629
|
+
state = 'update_x_set_a_op'
|
630
|
+
elif state == 'update_x_set_a_op':
|
492
631
|
if token.ttype in [T.Literal.String.Single, T.Name]:
|
493
|
-
state = '
|
494
|
-
elif state == '
|
632
|
+
state = 'update_x_set_sc'
|
633
|
+
elif state == 'update_x_set_sc':
|
495
634
|
if token.ttype == T.Punctuation and token.value == ',':
|
496
|
-
state = '
|
635
|
+
state = 'update_x_set_sc,'
|
497
636
|
elif token.ttype == T.Text.Whitespace:
|
498
|
-
state = '
|
499
|
-
elif state == '
|
637
|
+
state = 'update_x_set_sc_'
|
638
|
+
elif state == 'update_x_set_sc,':
|
500
639
|
if token.ttype == T.Name:
|
501
640
|
state = 'update_x_set_a'
|
502
|
-
elif state == '
|
641
|
+
elif state == 'update_x_set_sc_':
|
503
642
|
if token.ttype == T.Punctuation and token.value == ',':
|
504
|
-
state = '
|
643
|
+
state = 'update_x_set_sc,'
|
505
644
|
elif token.ttype == T.Keyword and token.value.lower() == 'where':
|
506
|
-
state = '
|
507
|
-
elif state == '
|
645
|
+
state = 'update_where'
|
646
|
+
elif state == 'update_where':
|
508
647
|
if token.ttype == T.Text.Whitespace:
|
509
|
-
state = '
|
510
|
-
elif state == '
|
648
|
+
state = 'update_where_'
|
649
|
+
elif state == 'update_where_':
|
511
650
|
if token.ttype == T.Name:
|
512
|
-
state = '
|
513
|
-
elif state == '
|
651
|
+
state = 'update_where_a'
|
652
|
+
elif state == 'update_where_a':
|
514
653
|
if token.ttype == T.Operator.Comparison:
|
515
|
-
state = '
|
516
|
-
elif state == '
|
654
|
+
state = 'update_where_a_op'
|
655
|
+
elif state == 'update_where_a_op':
|
517
656
|
if token.ttype in [T.Literal.String.Single, T.Name]:
|
518
|
-
state = '
|
519
|
-
elif state == '
|
657
|
+
state = 'update_where_sc'
|
658
|
+
elif state == 'update_where_sc':
|
520
659
|
if token.ttype == T.Text.Whitespace:
|
521
|
-
state = '
|
522
|
-
elif state == '
|
660
|
+
state = 'update_where_sc_'
|
661
|
+
elif state == 'update_where_sc_':
|
523
662
|
if token.ttype == T.Keyword and token.value.lower() in ['and', 'or']:
|
524
|
-
state = '
|
663
|
+
state = 'update_where'
|
525
664
|
|
526
665
|
elif state == 'delete':
|
527
666
|
if token.ttype == T.Text.Whitespace:
|
@@ -540,25 +679,25 @@ class SqlCompleter(Completer):
|
|
540
679
|
state = 'delete_from_x_'
|
541
680
|
elif state == 'delete_from_x_':
|
542
681
|
if token.ttype == T.Keyword and token.value.lower() == 'where':
|
543
|
-
state = '
|
544
|
-
elif state == '
|
682
|
+
state = 'delete_where'
|
683
|
+
elif state == 'delete_where':
|
545
684
|
if token.ttype == T.Text.Whitespace:
|
546
|
-
state = '
|
547
|
-
elif state == '
|
685
|
+
state = 'delete_where_'
|
686
|
+
elif state == 'delete_where_':
|
548
687
|
if token.ttype == T.Name:
|
549
|
-
state = '
|
550
|
-
elif state == '
|
688
|
+
state = 'delete_where_a'
|
689
|
+
elif state == 'delete_where_a':
|
551
690
|
if token.ttype == T.Operator.Comparison:
|
552
|
-
state = '
|
553
|
-
elif state == '
|
691
|
+
state = 'delete_where_a_op'
|
692
|
+
elif state == 'delete_where_a_op':
|
554
693
|
if token.ttype in [T.Literal.String.Single, T.Name]:
|
555
|
-
state = '
|
556
|
-
elif state == '
|
694
|
+
state = 'delete_where_sc'
|
695
|
+
elif state == 'delete_where_sc':
|
557
696
|
if token.ttype == T.Text.Whitespace:
|
558
|
-
state = '
|
559
|
-
elif state == '
|
697
|
+
state = 'delete_where_sc_'
|
698
|
+
elif state == 'delete_where_sc_':
|
560
699
|
if token.ttype == T.Keyword and token.value.lower() in ['and', 'or']:
|
561
|
-
state = '
|
700
|
+
state = 'delete_where'
|
562
701
|
|
563
702
|
return state
|
564
703
|
|
adam/version.py
CHANGED
@@ -14,7 +14,7 @@ adam/repl_commands.py,sha256=WA90Rl27Juctzr3U3kfCDk5N-oYMKlfWbZeafUgk7k0,4723
|
|
14
14
|
adam/repl_session.py,sha256=uIogcvWBh7wd8QQ-p_JgLsyJ8YJgINw5vOd6JIsd7Vo,472
|
15
15
|
adam/repl_state.py,sha256=591d7gV6uQSFtm7IWdlIYAHjfAzs9bdvIkwlIAeKddE,7540
|
16
16
|
adam/utils.py,sha256=2DoWsrcaioFFH0-RjT30qelVRPUJqCGTfz_ucfE7F8g,7406
|
17
|
-
adam/version.py,sha256=
|
17
|
+
adam/version.py,sha256=kXINOe-uvId2Kbv9pAAleFVyJC-tHoAx6EmOAUzCUjY,139
|
18
18
|
adam/checks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
19
|
adam/checks/check.py,sha256=Qopr3huYcMu2bzQgb99dEUYjFzkjKHRI76S6KA9b9Rk,702
|
20
20
|
adam/checks/check_context.py,sha256=FEHkQ32jY1EDopQ2uYWqy9v7aEEX1orLpJWhopwAlh4,402
|
@@ -164,7 +164,7 @@ adam/k8s_utils/services.py,sha256=EOJJGACVbbRvu5T3rMKqIJqgYic1_MSJ17EA0TJ6UOk,31
|
|
164
164
|
adam/k8s_utils/statefulsets.py,sha256=hiBOmJZ3KTI6_naAFzNoW1NoYnnBG35BZ7RMdPhNC6o,4664
|
165
165
|
adam/k8s_utils/volumes.py,sha256=RIBmlOSWM3V3QVXLCFT0owVOyh4rGG1ETp521a-6ndo,1137
|
166
166
|
adam/sql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
167
|
-
adam/sql/sql_completer.py,sha256=
|
167
|
+
adam/sql/sql_completer.py,sha256=BAg1Ogn_q1JSjpQhN-2jVzIuMoH1FpFzn_xpMRvB-TQ,35882
|
168
168
|
adam/sql/term_completer.py,sha256=VCCMPUzvh_9lwIOwqQmeijM0V2JPADkBbNV4HQIqDCw,2538
|
169
169
|
adam/sso/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
170
170
|
adam/sso/authenticator.py,sha256=BCm16L9zf5aLU47-sTCnudn2zLPwd8M2wwRminJfsqw,615
|
@@ -176,8 +176,8 @@ adam/sso/idp.py,sha256=fvcwUw_URTgsO6ySaqTIw0zQT2qRO1IPSGhf6rPtybo,5804
|
|
176
176
|
adam/sso/idp_login.py,sha256=QAtCUeDTVWliJy40RK_oac8Vgybr13xH8wzeBoxPaa8,1754
|
177
177
|
adam/sso/idp_session.py,sha256=9BUHNRf70u4rVKrVY1HKPOEmOviXvkjam8WJxmXSKIM,1735
|
178
178
|
adam/sso/sso_config.py,sha256=5N8WZgIJQBtHUy585XLRWKjpU87_v6QluyNK9E27D5s,2459
|
179
|
-
kaqing-2.0.
|
180
|
-
kaqing-2.0.
|
181
|
-
kaqing-2.0.
|
182
|
-
kaqing-2.0.
|
183
|
-
kaqing-2.0.
|
179
|
+
kaqing-2.0.57.dist-info/METADATA,sha256=AJUgGbSTZ4aZy5vdBdNW076Iv-L5SKzR00IFzWOtDUk,132
|
180
|
+
kaqing-2.0.57.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
181
|
+
kaqing-2.0.57.dist-info/entry_points.txt,sha256=SkzhuQJUWsXOzHeZ5TgQ2c3_g53UGK23zzJU_JTZOZI,39
|
182
|
+
kaqing-2.0.57.dist-info/top_level.txt,sha256=8_2PZkwBb-xDcnc8a2rAbQeJhXKXskc7zTP7pSPa1fw,5
|
183
|
+
kaqing-2.0.57.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|