Make use of utility decorate

This commit is contained in:
wqy
2022-09-17 09:29:05 +08:00
parent bb93a51817
commit ee39d96120
2 changed files with 3 additions and 5 deletions

View File

@@ -26,8 +26,7 @@ def delete_reservoir(name: str, id: str) -> ChangeSet:
return
head = row['head']
pattern = 'NULL' if row['pattern'] == None else row['pattern']
pattern = f'"{pattern}"' if pattern != 'NULL' else pattern
pattern = utility.decorate(row['pattern'], 'str', True)
sql = f"delete from reservoirs where id = '{id}';"
undo_sql = f'insert into reservoirs (id, head, pattern) values ("{id}", {head}, {pattern});'