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

Allow for specifying a config path when using ConnectionResolver #863

Closed
1 task
matt2930 opened this issue Dec 5, 2023 · 0 comments · Fixed by #864
Closed
1 task

Allow for specifying a config path when using ConnectionResolver #863

matt2930 opened this issue Dec 5, 2023 · 0 comments · Fixed by #864
Labels
enhancement A feature that exists, works as intended but needs to be improved feature request A feature that does not yet exist but will be a good addition to the library

Comments

@matt2930
Copy link
Contributor

matt2930 commented Dec 5, 2023

Describe the feature as you'd like to see it
I want to be able to specify a custom config path without setting an extra environment variable.

What do we currently have to do now?
The current implementation of ConnectionResolver and ConnectionFactory does the following:

  1. ConnectionResolver inits ConnectionFactory
  2. When creating a new transaction, ConnectionFactory will run make, which calls DB = load_config().DB
  3. load_config() will either use the default config path, or use the DB_CONFIG_PATH env var

Additional context
The load_config function already has a config_path argument. So, my proposal is to:

  • Add an optional config_path argument to ConnectionResolver

  • Add an optional config_path argument to ConnectionFactory

  • Pass through that config_path from ConnectionResolver to the initialization of ConnectionFactory

  • Use the config_path in load_config

  • Is this a breaking change?

@matt2930 matt2930 added enhancement A feature that exists, works as intended but needs to be improved feature request A feature that does not yet exist but will be a good addition to the library labels Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature that exists, works as intended but needs to be improved feature request A feature that does not yet exist but will be a good addition to the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant