MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / connect

Method connect

pydevd_attach_to_process/winappdbg/sql.py:108–132  ·  view source on GitHub ↗

Called once by SQLAlchemy for each new SQLite DB-API connection. Here is where we issue some PRAGMA statements to configure how we're going to access the SQLite database. @param dbapi_connection: A newly connected raw SQLite DB-API connection.

(dbapi_connection, connection_record)

Source from the content-addressed store, hash-verified

106 """
107
108 def connect(dbapi_connection, connection_record):
109 """
110 Called once by SQLAlchemy for each new SQLite DB-API connection.
111
112 Here is where we issue some PRAGMA statements to configure how we're
113 going to access the SQLite database.
114
115 @param dbapi_connection:
116 A newly connected raw SQLite DB-API connection.
117
118 @param connection_record:
119 Unused by this method.
120 """
121 try:
122 cursor = dbapi_connection.cursor()
123 try:
124 cursor.execute("PRAGMA foreign_keys = ON;")
125 cursor.execute("PRAGMA foreign_keys;")
126 if cursor.fetchone()[0] != 1:
127 raise Exception()
128 finally:
129 cursor.close()
130 except Exception:
131 dbapi_connection.close()
132 raise sqlite3.Error()
133
134
135# ------------------------------------------------------------------------------

Callers 3

inputhook_qt4Function · 0.45
inputhook_qt6Function · 0.45
inputhook_qt5Function · 0.45

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected