'Switches to the connection specified by the given alias or index.
Updates :attr:`current` and also returns its new value.
Alias is whatever was given to :meth:`register` method and indices
are returned by it. Index can be given either as an integer or
as a string that can be converted to an integer. Raises an error
if no connection with the given index or alias found.'

def switch(self, alias_or_index):

    self.current = self.get_connection(alias_or_index)
    return self.current
