Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hooks support #202

Open
alondahari opened this issue Oct 17, 2023 · 5 comments
Open

Hooks support #202

alondahari opened this issue Oct 17, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@alondahari
Copy link

I was wondering if we could add support for custom callbacks that could run on certain events, hooks style. My desire is to load up the connection string from my password manager and create a tunnel when I try to connect to the db. What do you think?

@kristijanhusak kristijanhusak added the enhancement New feature or request label Dec 21, 2023
@neilsimp1
Copy link

Being able to run some arbitrary command like https://stackoverflow.com/a/1968446/4265939 before connecting would be really useful.

@kristijanhusak
Copy link
Owner

I recently added an ability to run a function for a connection. You should be able to do anything in the function and just return the connection string. You can see the example here https://github.com/kristijanhusak/vim-dadbod-ui#via-gdbs-global-variable

@neilsimp1
Copy link

Hmm..
I was hoping to be able to do it from https://github.com/kristijanhusak/vim-dadbod-ui?tab=readme-ov-file#via-dbuiaddconnection-command but this should work for what I needed. Thank you!

@kristijanhusak
Copy link
Owner

@neilsimp1 how would you suggest it works from the connection? Assuming that i have to store it as a string, what would you put inside of it?

@neilsimp1
Copy link

I see your point, it would not work well as part of a Connection String. It would have to some other property stored alongside the connection string. Some other property that could hold arbitrary commands to execute.
I would certainly understand if you viewed this as out of scope, though.

For background, I am transitioning from MySql Workbench to this. Workbench allowed storing Connection profiles as a DB connection over an SSH tunnel.
That's where I was coming from mentally and how I ended up finding this Issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants