def get_database(database_type=None):
    database_type = (database_type or 'mysql')
    database_type = database_type.lower()
    for db_cls in Database.__subclasses__():
        if (db_cls.type == database_type):
            return db_cls
    raise TypeError('Unsupported database type supplied.')
def get_database(database_type=None):
    database_type = (database_type or 'mysql')
    database_type = database_type.lower()
    for db_cls in Database.__subclasses__():
        if (db_cls.type == database_type):
            return db_cls
    raise TypeError('Unsupported database type supplied.')