Motivation
When we want to use Doctrine DBAL, we do not want to create a direct connection to the database because then we will have to also deal with multiple environments and the load balancer on our own. So we thought we might reuse the connection that is created in MW core and pass it to Doctrine's DBAL connection.
In https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/500837/5/lib/MediaWikiDoctrineDBALDriver.php, we experimented on how we can create a wrapper of MW db connection that implements Doctrine DBAL Driver Connection and be used with Doctrine DBAL Connection instance.
Now we want to implement the driver connections for the different databases supported by mw/wikibase properly as a separate library, which then we can use in Wikibase project wherever needed.