From a0e04e28bbab7ecc6a0c3b1bee72da303b82aebd Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Sun, 25 Aug 2024 21:18:08 +0200 Subject: split code into separate files --- modules/database.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 modules/database.py (limited to 'modules') diff --git a/modules/database.py b/modules/database.py new file mode 100644 index 0000000..f75f68e --- /dev/null +++ b/modules/database.py @@ -0,0 +1,12 @@ +import os.path +import sqlite3 +from pathlib import Path +from config import Config + +db_dir = os.path.dirname(Config.DATABASE_PATH) +Path(db_dir).mkdir(parents=True, exist_ok=True) + +assert sqlite3.threadsafety == 3, "QLite thread safety is not set to 'Serialized'." +sq_con = sqlite3.connect(Config.DATABASE_PATH) + +cursor = sq_con.cursor() -- cgit v1.2.3-70-g09d2