from peewee import * from models import db class BitMart30(Model): id = IntegerField(primary_key=True) # 时间戳(毫秒级) open = FloatField(null=True) high = FloatField(null=True) low = FloatField(null=True) close = FloatField(null=True) class Meta: database = db table_name = 'bitmart_30' # 连接到数据库 db.connect() # 创建表(如果表不存在) db.create_tables([BitMart30])