Run selected text only works in some cases

I've noticed that in any cases, like when a SQL statement is straightforward and only a single statement, it can be run by highlighting the text and running it.  However, it doesn't entirely ignore the context.  If I try to run a single query that is within a DO block (Postgres), it will try to run the whole file.  likewise I can't even run an EXPLAIN query by highlighting it.  It would be nice for only selected text to run, ignoring any surrounding SQL.  Is there a way to do that already or a plan to implement?  Thanks!

0
2 comments

Hello Jeremy.

Can you please specify exactly how do you run selected qury? Note that Ctrl+Enter shortcut corresponds to "Execute current multi line statement". But there is also an action "Execute selection" which should do what you want. This action does not have a default shortcut. You can bind the shortcut in the Settings:
2015-04-17_15-47-42.png

0

That's awesome Andrey and I think just what I needed to know.  Thank you!

0

Please sign in to leave a comment.