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
BUG: Run Current doesn't work as expected when there's only one query. #760
Comments
Hmm yes that sounds like a bug. Execute current should ideally execute the currently highlighted query, even if it does span across multiple lines. |
From my point of view, running only current line is more flexible and more safe solution. It could be use also in case of more single-line queries If user needs to run the entire query, he could use "Run" command |
If this behavior is chosen, I would expect it to be consistent. Currently, buffers with multiple queries behave as expected, where run current runs the current query. This is also how every DB client I've used behaves, and IMO is much more useful than the alternative. I've added some screenshots to show what's happening. |
I understand your point However, I am not sure that running entire query is safe. There is possibility, that query uses some nonstandard delimiters and dbgate's detection of query segments will result into one query. Then running the entire query could cause some damage, if user expects running of query part. Safe option could be to ask user, whether to run the entire query, when no parts were detected and he will execute "Run current" command |
Describe the bug
When there is only one query in the buffer, "Run Current" will run the current line instead of the current query.
To Reproduce
Steps to reproduce the behavior:
Run Current
Expected behavior
The entire query should be run. "Current" should mean the current query, and DbGate should send the entire multiline query to the DB to execute. II previously asked about this issue in #743 But have sinced realized that it only occurs when there is only one query.
Screenshots
If applicable, add screenshots to help explain your problem.
Run current when cursor is on line 4.
Run current with same query highlighted.
Run current behaves correctly when there are multiple queries.
Version Information (please complete the following information):
The text was updated successfully, but these errors were encountered: