数据库使用的是val还是value?是不是有些错误?
DreamSilverFox opened this issue · 2 comments
DreamSilverFox commented
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
pangao1990 commented