I have a Symfony application that shares the same codebase for many DBs.
It's quite typical, I have a single database for each "instance" (or "account") of my application, which is a simple medical appointments tool. I need to keep this architecture as is.
However, we are migrating from Symfony 2.8 to Symfony 4. Before Symfony 4, I had to create a "pseudo-prod" Symfony environment for each DB, because Symfony (with Doctrine) is very tied to having a single DB specified by the config, and even using env vars like SYMFONY__DATABASE__NAME, the database connection properties get hardcoded into the cache, so I needed to create a different environment for each app instance, hence creating a cache dir for each account, which is far from ideal.
Will the new env vars features from Symfony 4 make dynamic DB connection more feasible in a "native" manner?
Should I use another method to achieve this? (for example, creating a custom connection factory, etc)
I would like to have a single cache for my prod environment, and let the connection parameters be dynamic.
Any ideas appreciated. Thanks!
Note:
This is NOT a duplicate of: Using Relationships with Multiple Entity Managers
I am already using multiple entity managers, it has nothing to do with that.