def __init__(self, name=None, threadlocal=True): super(DynamicMetaData, self).__init__(name) if threadlocal: self.context = util.ThreadLocal() else: self.context = self self.__engines = {}
def __init__(self, *args, **kwargs): """The TLEngine relies upon the ConnectionProvider having "threadlocal" behavior, so that once a connection is checked out for the current thread, you get that same connection repeatedly. """ super(TLEngine, self).__init__(*args, **kwargs) self.context = util.ThreadLocal()
def __init__(self, *args, **kwargs): """Construct a new TLEngine.""" super(TLEngine, self).__init__(*args, **kwargs) self.context = util.ThreadLocal() proxy = kwargs.get('proxy') if proxy: self.TLConnection = base._proxy_connection_cls(TLConnection, proxy) else: self.TLConnection = TLConnection
def __init__(self, pool=None, echo=False, logger=None, default_ordering=False, echo_pool=False, echo_uow=False, **params): """constructs a new SQLEngine. SQLEngines should be constructed via the create_engine() function which will construct the appropriate subclass of SQLEngine.""" # get a handle on the connection pool via the connect arguments # this insures the SQLEngine instance integrates with the pool referenced # by direct usage of pool.manager(<module>).connect(*args, **params) (cargs, cparams) = self.connect_args() if pool is None: params['echo'] = echo_pool self._pool = sqlalchemy.pool.manage(self.dbapi(), **params).get_pool(*cargs, **cparams) else: self._pool = pool self.default_ordering=default_ordering self.echo = echo self.echo_uow = echo_uow self.context = util.ThreadLocal(raiseerror=False) self.tables = {} self._ischema = None self._figure_paramstyle() if logger is None: self.logger = sys.stdout else: self.logger = logger
def __init__(self, *args, **kwargs): """Construct a new TLEngine.""" super(TLEngine, self).__init__(*args, **kwargs) self.context = util.ThreadLocal()