-
Notifications
You must be signed in to change notification settings - Fork 132
feat: Add support for Explain feature #1852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
1ea42dd
8c7a5b0
177f07f
242e351
053dd92
0677368
87069ed
436775b
5047608
f09c6e3
411ca77
f663865
4b7127d
e3614be
e125c42
af79b7b
7a1937a
d0c6abf
9f084ba
0f76847
daddd3e
e38e917
60ad94e
e2813ab
32fc9de
e57da64
b4101ad
c59e964
a767158
1a8fd85
50808f1
1f4aa32
0610cae
faaa7cd
dc9dab2
4177cdd
105d8a5
6162363
d58acc0
638ae76
07e521c
dd9e83e
55f1736
2d7649f
40b3f89
c272165
10f06e8
8695453
0b66c53
a08c293
9996f1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,14 @@ | |
"method": "statementShowTransactionIsolationLevel", | ||
"exampleStatements": ["show transaction isolation level","show variable transaction isolation level"] | ||
}, | ||
{ | ||
"name": "EXPLAIN '<sql>'", | ||
gauravsnj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"executorName": "ClientSideStatementNoParamExecutor", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This won't work, as the method that you have defined has a parameter; the sql string that is to be explained is the input parameter in this case. You have two options for this:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think creating a new executor class will be better as ClientSideStatementSetExecutor is for specific type of commands and EXPLAIN clearly doesn't fit in that type. What do you say? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that would be the neatest solution for this. |
||
"resultType": "RESULT_SET", | ||
"regex": "(?is)\\A\\s*explain\\s+(.*)\\z", | ||
"method": "statementExplain", | ||
"exampleStatements": ["explain select"] | ||
}, | ||
{ | ||
"name": "{START | BEGIN} [TRANSACTION | WORK] [{ (READ ONLY|READ WRITE) | (ISOLATION LEVEL (DEFAULT|SERIALIZABLE)) }]", | ||
"executorName": "ClientSideStatementPgBeginExecutor", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here also use
"\\s+"
to split the string, and consider combining the two calls tosplit
into one.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done