MCPcopy Create free account
hub / github.com/TheSecuredAnalyst/security-suite / _get_connection

Function _get_connection

core/db.py:34–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32
33
34def _get_connection() -> sqlite3.Connection:
35 if not hasattr(_local, "conn") or _local.conn is None:
36 _DB_PATH.parent.mkdir(parents=True, exist_ok=True)
37 conn = sqlite3.connect(str(_DB_PATH), check_same_thread=False)
38 conn.row_factory = sqlite3.Row
39 conn.execute("PRAGMA journal_mode=WAL")
40 conn.execute("PRAGMA foreign_keys=ON")
41 _local.conn = conn
42 return _local.conn
43
44
45@contextmanager

Callers 1

get_dbFunction · 0.85

Calls 1

connectMethod · 0.80

Tested by

no test coverage detected