MCPcopy Create free account
hub / github.com/Eve-PySpy/PySpy / connect_persistent_db

Function connect_persistent_db

db.py:35–47  ·  view source on GitHub ↗

Create on disk database @returns: connection and cursor objects as conn and cur

()

Source from the content-addressed store, hash-verified

33 return conn, cur
34
35def connect_persistent_db():
36 '''
37 Create on disk database
38
39 @returns: connection and cursor objects as conn and cur
40 '''
41 Logger.info("Connecting to persistent DB - {}".format(config.DB_FILE))
42 conn = sqlite3.connect(config.DB_FILE)
43 cur = conn.cursor()
44 cur.execute("PRAGMA journal_mode = TRUNCATE")
45 prepare_tables(conn, cur)
46 prepare_ship_data(conn, cur)
47 return conn, cur
48
49def prepare_tables(conn, cur):
50 '''

Callers

nothing calls this directly

Calls 2

prepare_tablesFunction · 0.85
prepare_ship_dataFunction · 0.85

Tested by

no test coverage detected