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
161 stars 47 forks source link

Connection config loading #796

Closed Marlysson closed 1 year ago

Marlysson commented 1 year ago

@josephmancuso @girardinsamuel Closes #793 Closes #794

1. Config Module

Maybe a second solution is cascading the config_path variable

Changing the way of config_path is loaded in load() module.

For the first load from the environment, it if is None, use the custom or default value and finally define the value back to DB_CONFIG_PATH environment ( which is first loaded in function call ).

Don't cascading the config_path value cause some classes already use the connection class previously loaded on top of modules.

Schema: https://github.com/MasoniteFramework/orm/blob/2.0/src/masoniteorm/schema/Schema.py#L89 ConnectionFactory: https://github.com/MasoniteFramework/orm/blob/2.0/src/masoniteorm/connections/ConnectionFactory.py#L38

2. Arguments in Seed Run Removing the second parameter in self.option() function, it already uses the default from the definition.