soniagtm opened a new pull request, #27314: URL: https://github.com/apache/superset/pull/27314
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY <!--- Describe the change below, including rationale and design decisions --> When a user enters multiple queries in one tab and wants to execute each of them, they would have to highlight the SQL they want to execute (in previous versions), which would not be ideal for extremely long queries. To solve this problem, I created the getCurrentQuery function to **allow executing each query without the need to highlight the specific query they wish to run**. Instead, users can **place the cursor at the intended query and press the RUN button**. It's important to note that **queries must be separated by either at least one blank line or a semicolon**, and **no blank lines are allowed within the same query**. When the cursor is placed at the blank lines between two queries, the upper query will be executed. This also handles the case when a semicolon is part of the query. This function was actually created a long time ago, and I found that in newer versions, there already exists a shortcut key to execute the current query. I wanted to share this implementation in case it might be useful or maybe created as another shortcut key. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> **Before** https://github.com/apache/superset/assets/96282005/ce96ec0b-9462-4f6d-9c49-01a91fe6b947 **After** https://github.com/apache/superset/assets/96282005/755150a8-a985-4308-90a6-d584f5a3a711 ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> 1. Go to SQL Lab 2. Enter multiple queries in one tab (separate with semicolon or with a line break) 3. Move cursor to desired query to run 4. Press Run button ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
