14 lines
381 B
Python
14 lines
381 B
Python
from peewee import SqliteDatabase, Model, CharField, IntegerField, FloatField, BooleanField
|
|
|
|
from core.logger import LogLevel, PrintLog
|
|
from xtquant import xtconstant
|
|
|
|
# 连接到SQLite数据库
|
|
db = SqliteDatabase('example.db')
|
|
|
|
db.connect()
|
|
PrintLog(LogLevel.INFO, '- [成功]数据库连接')
|
|
# 定义基础模型类
|
|
class BaseModel(Model):
|
|
class Meta:
|
|
database = db |