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

Support multiple ENV vars #523

Open
zbolan opened this issue May 18, 2023 · 1 comment
Open

Support multiple ENV vars #523

zbolan opened this issue May 18, 2023 · 1 comment

Comments

@zbolan
Copy link

zbolan commented May 18, 2023

Is your feature request related to a problem? Please describe.

In large projects, especially monorepos, there can be multiple databases, users, etc. While it is trivial to have multiple 'config' files that support each DB, it is not acceptable to commit these credentials into source. The library currently supports common PG ENV variables but this is limited to a single database, making it impossible to define multiple ENV

Describe the solution you'd like

Taking inspiration from the templatized {{dir}} {{name}} I plan to allow consumers to dynamically specify which ENV vars to use in the db config:

{
  ...,
  "db": {
    "host": "{{MY_DB_HOST}}",
    "port":"{{MY_DB_PORT}}",
    "user": "{{MY_DB_USER}}",
    "dbName": "{{MY_DB_NAME}}",
    "password": "{{MY_DB_PASSWORD}}"
  }
}

It should be simple enough to have the config parser pick up these variables rather than use the default PG onese

Additional context
Somewhat related to #504

@zbolan
Copy link
Author

zbolan commented May 18, 2023

#524

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant