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
RFE - Allow running query as selection(s) from buffer, rather than writing entire buffer? Auto-folded results when multiple outputs? #30
Comments
I added the folding, please give it a test. Executing selection requires a bit more work so it will be done eventually. |
Support for executing the selection is added. |
I've made folding according to output from postgres, which returns empty row betweeen the queries, and everything else has some content (no empty row between last table entry and count). Not sure how to tackle these different outputs between database types, but i'll try to figure something out. |
Understood, I was just thinking to myself that the query output ending with a blank line and then another line with the number of rows returned might be specific to mssql server and might not be consistent depending on the db one is using. |
I just pushed a small change, but I don't have sqlserver db to test with currently. Can you pull and see if it works? |
Great! I just need to check mysql, it outputs things even more differently. |
I set it up for mysql also, so it should be good to go. Closing. |
Is there a command for executing on the a single selection of sql that we can remap? I want to remap from Leader < S > to something else. This is pretty great! |
autocmd FileType sql nnoremap <your-mapping> <Plug>(DBUI_ExecuteQuery) https://github.com/kristijanhusak/vim-dadbod-ui/blob/master/doc/dadbod-ui.txt#L308 |
Thanks - RTFM |
Originally posted by @moorecode in #8 (comment)
Following up on the comment above. Is this possible in any way? This would be a really useful feature.
I don't know if you've used cosminadrianpopescu's sql-workbench plugin (cosminadrianpopescu/vim-sql-workbench) which I know uses SQLWorkbench/J as its back-end and thus is different from what you may have available, but his does have this feature.
Another feature that the sql-workbench plugin has that would be amazing if it could be implemented here is it automatically autofolds query output in the results buffer when run with multiple queries, or for successive queries even. The current query is always expanded, but all previous results are autofolded.
It makes it really easy to navigate between result sets in the results buffer. (I've attached a screen grab which shows an example of this for reference.)
BTW yours is really an amazingly useful plugin! Thanks so much for creating and sharing, it is much appreciated.
The text was updated successfully, but these errors were encountered: