MasoniteFramework / orm

Masonite ORM is a beautiful Python ORM. It's also a nearly drop in replacement of the Orator ORM
https://orm.masoniteproject.com
MIT License
160 stars 47 forks source link

Allow for specifying a config path when using ConnectionResolver #863

Closed matt2930 closed 7 months ago

matt2930 commented 7 months ago

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: