Skip to content

Commit b7c4763

Browse files
authored
feat(webui): Modify ANTLR grammar to support parsing individual SQL fields. (#1521)
1 parent 62b21b8 commit b7c4763

File tree

3 files changed

+2995
-2707
lines changed

3 files changed

+2995
-2707
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
11
grammar Sql;
22

33
import SqlBase;
4+
5+
selectItemList
6+
: selectItem (',' selectItem)*
7+
;
8+
9+
standaloneSelectItemList
10+
: selectItemList EOF
11+
;
12+
13+
standaloneBooleanExpression
14+
: booleanExpression EOF
15+
;
16+
17+
sortItemList
18+
: sortItem (',' sortItem)*
19+
;
20+
21+
standaloneSortItemList
22+
: sortItemList EOF
23+
;

components/webui/client/src/sql-parser/generated/SqlLexer.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ export default class SqlLexer extends Lexer {
273273
public static readonly EOF = Token.EOF;
274274

275275
public static readonly channelNames: string[] = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN" ];
276-
public static readonly literalNames: (string | null)[] = [ null, "'.'",
277-
"'('", "')'",
278-
"','", "'?'",
276+
public static readonly literalNames: (string | null)[] = [ null, "','",
277+
"'.'", "'('",
278+
"')'", "'?'",
279279
"'->'", "'['",
280280
"']'", "'=>'",
281281
"'ADD'", "'ADMIN'",
@@ -988,8 +988,8 @@ export default class SqlLexer extends Lexer {
988988
491,2212,1,0,0,0,493,2216,1,0,0,0,495,2226,1,0,0,0,497,2234,1,0,0,0,499,
989989
2245,1,0,0,0,501,2256,1,0,0,0,503,2279,1,0,0,0,505,2307,1,0,0,0,507,2325,
990990
1,0,0,0,509,2334,1,0,0,0,511,2336,1,0,0,0,513,2338,1,0,0,0,515,2355,1,0,
991-
0,0,517,2370,1,0,0,0,519,2376,1,0,0,0,521,522,5,46,0,0,522,2,1,0,0,0,523,
992-
524,5,40,0,0,524,4,1,0,0,0,525,526,5,41,0,0,526,6,1,0,0,0,527,528,5,44,
991+
0,0,517,2370,1,0,0,0,519,2376,1,0,0,0,521,522,5,44,0,0,522,2,1,0,0,0,523,
992+
524,5,46,0,0,524,4,1,0,0,0,525,526,5,40,0,0,526,6,1,0,0,0,527,528,5,41,
993993
0,0,528,8,1,0,0,0,529,530,5,63,0,0,530,10,1,0,0,0,531,532,5,45,0,0,532,
994994
533,5,62,0,0,533,12,1,0,0,0,534,535,5,91,0,0,535,14,1,0,0,0,536,537,5,93,
995995
0,0,537,16,1,0,0,0,538,539,5,61,0,0,539,540,5,62,0,0,540,18,1,0,0,0,541,

0 commit comments

Comments
 (0)