-
Notifications
You must be signed in to change notification settings - Fork 147
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
SQLLINE-239: Add extra confirmation step for destructive commands like e Drop/Delete to avoid accidental executions. #263
Conversation
e423768
to
d11b695
Compare
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.
In general it looks ok, however I mentioned some issues which I think are better to be fixed.
+ Could you please fix indentations according to style in files you have updated
d11b695
to
da0ded7
Compare
da0ded7
to
1274581
Compare
957d777
to
f2b63b9
Compare
@snuyanzin @julianhyde I have tried fixing all the comments. Feel free to be specific in case I am missing something. |
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.
Teammate of Swaroopa here. Took a brief look at this, not too familiar with the code base but a few questions/comments.
2af02b2
to
e81409d
Compare
src/main/java/sqlline/Commands.java
Outdated
if (Pattern.compile(pattern).matcher(sql).find() | ||
&& sqlLine.getOpts().getConfirm()) { | ||
String question = sqlLine.loc("really-perform-action"); | ||
final int userResponse = getUserAnswer(question, 'y', 'n'); |
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.
Potential answers can be 'Y' and 'N' (uppercase only)
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.
It is not clear why uppercase only, for instance in Linux there could be lowercase answers for similar questions.
May be it makes sense to specify both upper and lowercase
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.
Nothing specific, its just that it introduces a small delay since we need to put a thought for upper case letters. Its a good to have thing, I am fine with either.
Can we configure it using command line? |
Yes it is possible for any property like
or it also could be specified inside |
e81409d
to
eeac43c
Compare
Thank you @dbwong @karanmehta93 @snuyanzin @julianhyde for reviewing my PR. Per me, I have fixed the comments. |
@julianhyde @snuyanzin @jongyeol @arina-ielchiieva Can one of you please merge this? Thanks. |
@swaroopak thank you for your corrections. Now it looks much better. |
@snuyanzin Thanks for your reply. I fail to see what you mentioned as indentations in SqlLineArgsTest.java. I opened the file with vim, sublime and IntelliJ. It opens properly indented. Please help me understand. |
@swaroopak sorry for the delay.
|
…e Drop/Delete to avoid accidental executions.
eeac43c
to
9266f0f
Compare
@snuyanzin Thanks for your detailed review about spaces. Is there a template file that can be included in intellij/eclipse? I have manually fixed those spaces for now, but it would be nice to have that which can save someone from missing such indentations. |
@snuyanzin I wonder how changing spaces failed the build? I checked it says some java doc error!? |
@swaroopak This problem seems JDK issue. https://bugs.openjdk.java.net/browse/JDK-8219474 I see the same error when
|
I also confirmed that this change works for me. This one is better.
|
Please discard the previous PR(#249) . Something got messed up and I could not see the changes as expected.