Ejemplo n.º 1
0
    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())
Ejemplo n.º 2
0
            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)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
 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)
Ejemplo n.º 5
0
 def first_connect(dbapi_connection, connection_record):
     c = base.Connection(engine, connection=dbapi_connection,
                         _has_events=False)
     dialect.initialize(c)
Ejemplo n.º 6
0
 def first_connect(conn, rec):
     c = base.Connection(engine, connection=conn)
     dialect.initialize(c)