- I open a :Term window, in which I run the sql client (i.e. ":Texec sqlite\ foo.sqlite" or ":Texec mysql\ foo", etc)
- From there, I can run whatever SQL command normally.
If I'm then in another buffer, and assuming there's only one :Term open, I can:
- visually select something, and :TREPLSendSelection to have it sent to the terminal along with a newline, thus executed (i.e. type ".schema" on one line, V then :TREPLSendSelection, ENTER, done - it gets executed in the terminal and the output shown) or "vap" to select a full paragraph and :TREPLSendSelection to send it all, for multi-line queries
- alternatively, :TREPLSendLine to send the current line
- alternatively, :TREPLSendFile to send the whole file (useful when the whole file both undoes and does things, to easily recreate a database structure)
I've found those simple things ("just have a terminal", "send stuff to it") to be very powerful, without having additional tools which, moreover, listen willy nilly on the network.
Just a little bit of UNIX knowledge saves you a load of unnecessary plugin installs.
To be clear; this is not some kind of premature optimization argument. I think plugin installs are ok as well as their memory & persistent storage requirements. What I worry about is the storage capacity of my brain.
I don't want to know about one more plugin unless it introduces a significant benefit on top of the already existing capabilities of the program in question.
Looks nice though, maybe I'll try it out sometime!
[0] https://github.com/tpope/vim-dadbod
[1] au FileType sql nmap <leader>d :%:DB g:db<CR>