MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / connect

Method connect

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

Source from the content-addressed store, hash-verified

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

Calls 3

cursorMethod · 0.45
executeMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected