-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
feat(sqllab): add shortcut for run current sql #24329
Conversation
This is awesome! I'll review it tomorrow. |
/testenv up |
@michael-s-molina Container image not yet published for this PR. Please try again when build is complete. |
@michael-s-molina Ephemeral environment creation failed. Please check the Actions logs for details. |
Codecov Report
@@ Coverage Diff @@
## master #24329 +/- ##
==========================================
- Coverage 69.09% 68.95% -0.15%
==========================================
Files 1906 1907 +1
Lines 74108 74177 +69
Branches 8165 8190 +25
==========================================
- Hits 51207 51148 -59
- Misses 20778 20906 +128
Partials 2123 2123
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 7 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
/testenv up |
@michael-s-molina Container image not yet published for this PR. Please try again when build is complete. |
@michael-s-molina Ephemeral environment creation failed. Please check the Actions logs for details. |
@justinpark Ephemeral environments are not working anymore. |
If the cursor is at the end of the line, it will jump to the next statement. Screen.Recording.2023-06-09.at.14.44.03.mov |
Should we ignore comments? Screen.Recording.2023-06-09.at.14.47.42.mov |
To me it should be any query delimited by semi-colon OR (start/end of file) around the cursor should be picked. If the cursor is just after the semicolon, next query should be picked. If I am editing a specific query my cursor is likely going to be inside that query, |
As Chandraprakash mentioned, this is intended. If the cursor is the next to the semi column, it will jump to the next statement. |
As we faced the regression of handling comments in FE, ignoring comments makes more complex and can be an issue in some edge cases. I'd rather make simple (including comments) to make features functional. |
159f3a7
to
c1d882e
Compare
Is it possible to send the delimited query for execution without actually selecting the query in the UI? If not i guess this can be a stepping stone to end goal some day. |
I think this is a great suggestion from an usability perspective. It's quite common to edit the statement after a failed query. That's actually the default behavior of many database tools. Here's an example of DBeaver: Screen.Recording.2023-06-14.at.08.44.56.mov |
We can try to pass an additional parameter into |
Can we please merge this change. |
The iterative approach makes sense given that the current behavior already offers a valuable feature. |
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.
LGTM
@justinpark Thanks for this nice PR! |
c1d882e
to
ea9beb7
Compare
cc: @cploonker @michael-s-molina @EugeneTorap As suggested, I updated the selection back to the current cursor position. without.selection.mov |
ooohhh nice |
@justinpark Merge it? |
Co-authored-by: Justin Park <[email protected]> (cherry picked from commit 1473d97)
Co-authored-by: Justin Park <[email protected]> (cherry picked from commit 1473d97)
Agreed, this has been long overdue, thanks for this work @justinpark ! ❤️ |
Co-authored-by: Justin Park <[email protected]>
SUMMARY
The manual selection of the current query is time-consuming. (Longer the query more time it takes to select manually)
This commit creates a new shortcut(
ctrl + shift + enter
) which automatically detects and selects the range of the current query and then run the selection in order to reduce the manual selection work.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After:
current.query.mov
Before:
before--current-sql.mov
TESTING INSTRUCTIONS
Hit "Ctrl+Shift+Enter" on sql editor
ADDITIONAL INFORMATION