'Return the SQLAlchemy database dialect class corresponding
to this URL\'s driver name.'

def get_dialect(self):

    if ('+' not in self.drivername):
        name = self.drivername
    else:
        name = self.drivername.replace('+', '.')
    cls = registry.load(name)
    if (hasattr(cls, 'dialect') and isinstance(cls.dialect, type) and issubclass(cls.dialect, Dialect)):
        return cls.dialect
    else:
        return cls
