Skip to content

Commit

Permalink
perf: 数据库迁移至 data 目录下
Browse files Browse the repository at this point in the history
  • Loading branch information
Soulter committed May 19, 2024
1 parent bc92935 commit f6be191
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions persist/session.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import sqlite3
import yaml
import os
import shutil
import time
from typing import Tuple


class dbConn():
def __init__(self):
# 读取参数,并支持中文
conn = sqlite3.connect("data.db")
db_path = "data/data.db"
if os.path.exists("data.db"):
shutil.copy("data.db", db_path)
conn = sqlite3.connect(db_path)
conn.text_factory = str
self.conn = conn
c = conn.cursor()
Expand Down

0 comments on commit f6be191

Please sign in to comment.