kndndrj / nvim-dbee

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

Add icon or highlight indication of inactive connection #104

Open petobens opened 2 months ago

petobens commented 2 months ago

As it can be seen in the GIF there is no easy way to distinguish where a defined connection is active/available or not. In the GIF my docker-postgres connection is not active but the only way to see that is to try to open such connection. Therefore I was wondering whether a new highlight group/icon/candy could be introduced to signal that a connection is inactive (for instance the note candies allow to distinguish between open and closed notes).

Peek 2024-04-20 18-14

petobens commented 2 months ago

Also would it be possible to add a config option to hide either the global or local notes? Thanks!

kndndrj commented 2 months ago

Hey, thanks for another suggestion!

The connections for most of go db clients are lazy, which means that it doesn't establish a connection until a query needs to be executed. I agree, that it would be nice to have a way to quickly see which connections are active or not, but it would require pinging the database. This pinging might not be desireable if you have a lot of databases configured though.

One idea that comes to mind is to ping databases asynchronously - and when asking for status it gives us back this state. This might be something I actually implement, but it might take a while.

As for the notes visibility, it is doable, but again, might take some time.

petobens commented 2 months ago

Great. Thanks for the feedback!