very verbose but the only way to determine if we our DriverConnection is Mysql
1. can be Mysqli
2. could be a wrapping Doctrine\DBAL\Connection with getDatabasePlatform
3. could be a PDOConnection where you need to access the driver

Determining this is not nice and doctrine could probably also abstract this logic for "upserts"
cc @beberlei