Skip to content

Support multiple ENV vars #523

@zbolan

Description

@zbolan

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions