Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| de8b3f0840 |
@@ -10,7 +10,7 @@ def connect(db_path: str) -> sqlite3.Connection:
|
|||||||
parent = os.path.dirname(os.path.abspath(db_path))
|
parent = os.path.dirname(os.path.abspath(db_path))
|
||||||
if parent and not os.path.exists(parent):
|
if parent and not os.path.exists(parent):
|
||||||
os.makedirs(parent, exist_ok=True)
|
os.makedirs(parent, exist_ok=True)
|
||||||
conn = sqlite3.connect(db_path, timeout=30)
|
conn = sqlite3.connect(db_path, timeout=30, check_same_thread=False)
|
||||||
conn.row_factory = sqlite3.Row
|
conn.row_factory = sqlite3.Row
|
||||||
conn.execute("PRAGMA journal_mode=WAL")
|
conn.execute("PRAGMA journal_mode=WAL")
|
||||||
conn.execute("PRAGMA busy_timeout=30000")
|
conn.execute("PRAGMA busy_timeout=30000")
|
||||||
|
|||||||
Reference in New Issue
Block a user