emmental/db/sql.py
Anna Schumaker b4daf0e48c db: Set check_same_thread=False
Apparently, the about-to-finish signal is called in a different thread
than the main thread. SQLite complains about the connection getting used
from a different thread, so we need to set this check to False so the
code skips it.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:15 -05:00

12 lines
307 B
Python

# Copyright 2021 (c) Anna Schumaker.
import lib
import sqlite3
File = lib.data.emmental_data / "emmental.sqlite"
Connection = sqlite3.connect(File, detect_types=sqlite3.PARSE_DECLTYPES, check_same_thread=False)
Connection.row_factory = sqlite3.Row
commit = Connection.commit
execute = Connection.execute