pangao1990 / PPX

基于Python和JavaScript,一键生成macOS、Windows和Linux平台客户端应用程序
https://blog.pangao.vip/docs-ppx/
GNU Affero General Public License v3.0
232 stars 39 forks source link

数据库使用的是val还是value?是不是有些错误? #33

Closed DreamSilverFox closed 10 months ago

DreamSilverFox commented 10 months ago
    def getStorageVar(self, key):
        '''获取储存变量'''
        resVal = ''
        dbSession = DB.session()
        with dbSession.begin():
            stmt = select(PPXStorageVar.value).where(PPXStorageVar.key == key)
            result = dbSession.execute(stmt)
            result = result.one_or_none()
            if result is None:
                # 新建
                stmt = insert(PPXStorageVar).values(key=key)
                dbSession.execute(stmt)
            else:
                resVal = result[0]
        dbSession.close()
        return resVal

def setStorageVar(self, key, val):
        '''更新储存变量'''
        dbSession = DB.session()
        with dbSession.begin():
            stmt = update(PPXStorageVar).where(PPXStorageVar.key == key).values(value=val)
            dbSession.execute(stmt)
        dbSession.close()

这两个函数是value,但是数据库里的列是val?

DreamSilverFox commented 10 months ago

Snipaste_2024-01-20_12-29-52

pangao1990 commented 10 months ago

已经在V4.2.1版本中修复了该问题,感谢指正!

image