vim-dadbod-ui
vim-dadbod-ui copied to clipboard
Folders in saved queries - #enhancement
Folders in saved queries?
I like the idea of having saved queries to save time from writing out sql - but if you have a lot of them, it's nice to have a folder structure that contains queries - it makes it easier to get to them.
Have you thought about supporting nested folders in saved queries?
I didn't really think about it, since i don't have that much saved queries, but I assume someone working a lot with DB would have them a bunch.
How would saving work? Would it prompt to ask in which folder to save?
I kind of worked around that. What I did - is set the "save location" to a folder where I already have my folders of saved queries (used in datagrip!) - I can open 'root' level query files from the drawer - and then they're in a buffer that will execute... Anything in a nested folder seems to be able to open one of the queries inside...
The existing UI "Save As" prompt - seems to work fine. I was able to save a query to a folder in my save location easy enough. Maybe use a bit of nerdtree autocompletion for folder names when typing a save name - but that seems like a 'nice to have' .
I'll see what it can be done.
@dgdosen you would expect these to go more than 1 level deep? Like folder in folder?
I don't - but others might. This is only a nice to have for me, because even with alot of files I can use vim search to find the file I want. This is/was a bigger issue when using something like DataGrip.
Yeah, I get it. I just want to avoid having a file manager as part of this. Not sure how DataGrip exactly works. Recently I introduced an option to save all query buffers to the specific location instead of tmp folder (https://github.com/kristijanhusak/vim-dadbod-ui/commit/9e81187a38cf493ef18f53cc051328024a9036f1#diff-407d2e0dc48982e36dbb0dab05e01850), so if there's need to keep things persistent this is a way to go.