def connect(self, **kwargs): """Return a Connection that is not thread-locally scoped. This is the equivalent to calling ``connect()`` on a ComposedSQLEngine. """ return base.Connection(self, self.connection_provider.unique_connection())
def first_connect(dbapi_connection, connection_record): c = base.Connection(engine, connection=dbapi_connection) # TODO: removing this allows the on connect activities # to generate events. tests currently assume these aren't # sent. do we want users to get all the initial connect # activities as events ? c._has_events = False dialect.initialize(c)
def first_connect(engine, dbapi_connection, connection_record): """ Like `sqlalchemy.engine.<locals>.first_connect` Without rolling back the transaction. https://github.com/sqlalchemy/sqlalchemy/blob/c2cad1f97c51c8a2a6ad5d371ece7bcd9c7ffcf9/lib/sqlalchemy/engine/create.py#L662 """ c = base.Connection( engine, connection=dbapi_connection, _has_events=False, # reconnecting will be a reentrant condition, so if the # connection goes away, Connection is then closed _allow_revalidate=False, ) c._execution_options = util.EMPTY_DICT engine.dialect.initialize(c)
def first_connect(dbapi_connection, connection_record): c = base.Connection(engine, connection=dbapi_connection, _has_events=False) c._execution_options = util.immutabledict() dialect.initialize(c)
def first_connect(dbapi_connection, connection_record): c = base.Connection(engine, connection=dbapi_connection, _has_events=False) dialect.initialize(c)
def first_connect(conn, rec): c = base.Connection(engine, connection=conn) dialect.initialize(c)