kndndrj / nvim-dbee

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

feat: add reload_sources method #80

Closed MattiasMTS closed 2 months ago

MattiasMTS commented 5 months ago

New feature allowing user to reload the connections/sources on demand.

The current scenario/setup I've is that when I start dbee for the first time, I run a bash script which fetches temporary credentials to my database and sets that in a connections.json file. When the credentials expires you can just source the same bash script again and ergo update the connections.json file.

However, depending on the "database user" (e.g. analyst/developer/admin), this doesn't work. So, I would have to refresh my source connection again by just reloading it.

Let me know if you don't think this is a method you want to open up to core entry require("dbee").reload_sources() and instead point them to use the core api export.

kndndrj commented 2 months ago

Thanks. However I don't really like this method, since the same for-loop can be done by the api user by first calling get_sources and then source_reload. Closing.