Create on disk database @returns: connection and cursor objects as conn and cur
()
| 33 | return conn, cur |
| 34 | |
| 35 | def 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 | |
| 49 | def prepare_tables(conn, cur): |
| 50 | ''' |
nothing calls this directly
no test coverage detected