vim-dadbod-ui icon indicating copy to clipboard operation
vim-dadbod-ui copied to clipboard

Folders in saved queries - #enhancement

Open dgdosen opened this issue 4 years ago • 6 comments

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?

dgdosen avatar Jul 24 '20 14:07 dgdosen

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?

kristijanhusak avatar Jul 24 '20 14:07 kristijanhusak

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' .

dgdosen avatar Jul 24 '20 14:07 dgdosen

I'll see what it can be done.

kristijanhusak avatar Jul 24 '20 15:07 kristijanhusak

@dgdosen you would expect these to go more than 1 level deep? Like folder in folder?

kristijanhusak avatar Aug 12 '20 12:08 kristijanhusak

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.

dgdosen avatar Aug 27 '20 17:08 dgdosen

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.

kristijanhusak avatar Aug 31 '20 11:08 kristijanhusak