I've done this. https://github.com/tractorcow/sapphire/blob/3.2-pdo-connector/model/connect/DBConnector.php#L44