summaryrefslogtreecommitdiff
path: root/modules/database.py
blob: 9a7131cfee30aab874c9af0c8f659c60edb61340 (plain)
1
2
3
4
5
6
7
8
9
10
11
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'."

conn = sqlite3.connect(Config.DATABASE_PATH)
cursor = conn.cursor()