Not sure If I understood you question correctly but here is what I would do if I need to derive “extra database” information after hitting the “base database”.
Lets say I have two extra databases out of which I would fetch the data from anyone depending on the information from base database. I would put the logic of connecting to the extra databases and connection to the main database together instead of making the connection in the middle of a request. Creating connection to databases is expensive and can slow down the response time considerably.
This is similar on how we would implement application level sharding of any database. This is also similar to an app which requires connection of two different databases like mySQL and Redis. Both the connections are made at the server start time.
Hope this helps. Thank you for encouraging words