'Bind to a Connectable in the caller\'s thread.'

@util.dependencies('sqlalchemy.engine.url')
def _bind_to(self, url, bind):

    if isinstance(bind, (util.string_types + (url.URL,))):
        try:
            self.context._engine = self.__engines[bind]
        except KeyError:
            e = sqlalchemy.create_engine(bind)
            self.__engines[bind] = e
            self.context._engine = e
    else:
        if (bind not in self.__engines):
            self.__engines[bind] = bind
        self.context._engine = bind
