This commit is contained in:
2025-11-11 16:47:55 +08:00
parent c42648d1b4
commit 662a1ea7c1
13 changed files with 361 additions and 638 deletions
+4 -6
View File
@@ -1,14 +1,12 @@
from peewee import SqliteDatabase, Model, CharField, IntegerField, FloatField, BooleanField
from peewee import SqliteDatabase, Model
from core.logger import LogLevel, PrintLog
from xtquant import xtconstant
# 连接到SQLite数据库
db = SqliteDatabase('example.db')
db: SqliteDatabase = SqliteDatabase('example.db')
db.connect()
PrintLog(LogLevel.INFO, '- [成功]数据库连接')
# 定义基础模型类
class BaseModel(Model):
class Meta:
database = db
database: SqliteDatabase = db