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

[FEATURE] multiple "configuration" support #137

Closed
julien opened this issue Oct 25, 2022 · 4 comments · Fixed by #138
Closed

[FEATURE] multiple "configuration" support #137

julien opened this issue Oct 25, 2022 · 4 comments · Fixed by #138
Labels
kind/enhancement New feature or request

Comments

@julien
Copy link

julien commented Oct 25, 2022

Is your feature request related to a problem? Please describe.
No, not at all.

Describe the solution you'd like
I really like the --config flag and I was wondering if it could be possible to add support for multiple configurations. I think that most developers using this tool have a local database, maybe another local database only used for testing purposes, and then a database for each environment in which the deploy their code.

Describe alternatives you've considered
The alternative is to add all your configurations in the $HOME/.dblab.yaml file and comment them, except the one you're going to use.

Additional context
dblab is a nice tool so thanks a lot for making it.

@julien julien added the kind/enhancement New feature or request label Oct 25, 2022
@danvergara
Copy link
Owner

danvergara commented Oct 26, 2022

Hi @julien. Thanks for the suggestion and the kind words.

First of all, I need more details to get this done as quickly as possible. I'm thinking of adding multiple connection sections to the config file and adding a new flag that tells the cli which config is to be used. The default value is the first one (if there's more than one). Is this aligned with the expected behavior you're thinking of?

@julien
Copy link
Author

julien commented Oct 26, 2022

Hey @danvergara,

You can take your time do implement this, there are probably multiple ways to do it, I just thought I'd propose it.
Your suggestion seems OK to me. You could also let the --config accept a value, for example:

dblab --config dev
# or dblab --config [configuration_name]

To make that happen you probably need to add a name property to each configuration too.

If the configuration exists, that's what you use, if it doesn't you can show an error and exit.
If the --config flag is passed without a value, then you just choose the first one defined in the configuration file (or alternatively, add a default (boolean) to each configuration so you know which one the user wants to use a the default).

Let me know what you think when you can.

@danvergara danvergara mentioned this issue Nov 29, 2022
11 tasks
@danvergara
Copy link
Owner

Hey @julien. Sorry for the delayed response. You were right, I was into multiple things. But I could come up with something to address your feature request. It's still a work in progress so far, but you can check it out in #138.

@julien
Copy link
Author

julien commented Dec 1, 2022

Hi @danvergara no worries and thanks a lot for implementing this.

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

Successfully merging a pull request may close this issue.

2 participants