Personally I think these should go in `/config/autoload/global.php` - modules shouldn't usually be defining DB details. I'd also put the `dsn` line in local.php with the username and password.