MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / connect

Method connect

test/dialect/postgresql/test_dialect.py:997–1003  ·  view source on GitHub ↗
(dbapi_connection, connection_record)

Source from the content-addressed store, hash-verified

995 @event.listens_for(engine, "connect", insert=True)
996 @event.listens_for(engine, "first_connect", insert=True)
997 def connect(dbapi_connection, connection_record):
998 cursor = dbapi_connection.cursor()
999 cursor.execute(
1000 "SET SESSION standard_conforming_strings = %s"
1001 % ("off" if not explicit_setting else "on")
1002 )
1003 dbapi_connection.commit()
1004
1005 with engine.connect():
1006 eq_(engine.dialect._backslash_escapes, expected)

Calls 3

cursorMethod · 0.45
executeMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected