fix: The type of the SQL field is incorrect
@@ -8,6 +8,11 @@ class SQLBase:
"""
tmp_list = []
for key, value in data.items():
+ if value is None:
+ tmp = "{k}={v}".format(k=key, v='null')
+ elif isinstance(value, int):
+ tmp = "{k}={v}".format(k=key, v=str(value))
+ else:
tmp = "{k}='{v}'".format(k=key, v=value)
tmp_list.append(tmp)
return ','.join(tmp_list)
@@ -19,6 +24,11 @@ class SQLBase:
"""
tmp_list = []
for key, value in conditions.items():
+ if value is None:
+ tmp = "{k}={v}".format(k=key, v='null')
+ elif isinstance(value, int):
+ tmp = "{k}={v}".format(k=key, v=str(value))
+ else:
tmp = "{k}='{v}'".format(k=key, v=value)
tmp_list.append(tmp)
return ' and '.join(tmp_list)
