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

How can I switch to multiple databases using multiple .env files depends on context? #815

Closed
divya-sk opened this issue May 4, 2021 · 2 comments
Labels

Comments

@divya-sk
Copy link

divya-sk commented May 4, 2021

I am using a single .env file to run against a single database.
Now I want to run against multiple databases using multiple .env files depends on the different context that we are passing
For example
if I passing the context ABC then I want to run the .abc.env file
just context=abc .abc.env

@casey casey added the question label May 4, 2021
@casey
Copy link
Owner

casey commented May 4, 2021

I don't think this is currently possible. There are a few open issues covering things like choosing the dotenv file with a flag, and another for dotenv-related settings. Do either of those look like they would work for your use-case?

@casey
Copy link
Owner

casey commented Aug 11, 2021

#941 added flags to control .env file loading, which helps with this, so I'm going to go ahead and close it. It isn't possible to set the .env file based on another variable, but I can't think of a good way to do that, because .env file loading has to happen before variable evaluation, since variable evaluation can depend on the variables from the .env file.

@casey casey closed this as completed Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants