kndndrj / nvim-dbee

Interactive database client for neovim
GNU General Public License v3.0
617 stars 40 forks source link

Feature request: disconnect from active connection #69

Open willruggiano opened 6 months ago

willruggiano commented 6 months ago

Self explanatory.

Also, I know I've been creating a bunch of issues (because I love this plugin so much and it is by far my most used plugin), so if some of these are (relatively; I don't know Go) simple and you can point me in the right direction I can submit a PR

kndndrj commented 6 months ago

I'm not entirely sure what do you mean with disconnect from active connection? All connections use the connection pool in go, which is a long lived object. It doesn't mean the connection is always established (AFAIK) and connects when needed. Now there might be issues with certain drivers not behaving as they should - which, I have a feeling is the case with duckdb, but other databases should be fine.

May I ask what motivated you to think about this feature in the first place?

Also, I'm happy you are enjoying the plugin! And also the issues are welcome!

willruggiano commented 6 months ago

My usecase is basically this:

During development I frequently want to drop and restore my local database from a known good snapshot of my production database. When I am using dbee, and only if I execute a query against my database (to your point: connections within dbee are lazy), I have to quit neovim entirely to cause the dbee session to drop and then I can drop and restore my local database. (I can't drop the database if there is an active session).

Admittedly it isn't the worst thing in the world, but it would be nice to have a way to kill any active dbee sessions so I didn't need to quit neovim entirely

kndndrj commented 3 months ago

Hey @willruggiano, I don't plan on supporting this use case, because dbee is a pretty big project already, BUT I added a "delete connection" method to the backend in #98, which can be maybe be exposed through the api.

I'll try looking into your use case, ut no promises :D

willruggiano commented 3 months ago

Thanks! I'll check out the pr.