vscode-postgres
vscode-postgres copied to clipboard
Feature Request: Run "current" query (slightly different from run selection)
First, love this extension, thanks for your hard work! Second, my vote for a future feature :)
Some other tools have the ability to look at where the cursor is and run the query within that "context". i.e. it looks backwards until it finds the start of the query and then forward until it finds a terminating expression (i.e. semicolon) or the end of the file. Understandably this is a good bit harder because it requires some knowledge of the AST of the SQL file, but it's a big timesaver (moving the cursor is much quicker than highlighting a block).
Partly possible - if you select the query, you can run that isolated one.
Thanks @Borvik ! I'm aware of that functionality. The suggestion was to take it a step further and figure out what the current query is based on cursor position. Definitely understand if this is out of scope though.
Not technically "out of scope", but nowhere near ready. I've been trying to find a good way to get a better parser rather than relying on EXPLAIN but it's not easy to find. The even greater difficulty is that if I'm doing the parsing here, then the version of the language being parsed may not match the server version that it is connected too, and keeping multiple versions up to date would be something of a challenge.
Thanks for the update. I certainly understand the complexity, and you make a great point about possibility for incompatibility between parsed language version vs actual server version. Feel free to treat this issue as you see fit. You can leave it open in case a better parsing library becomes available, or if it's just noise for you feel free to close it.