Code refactor for change set
This commit is contained in:
@@ -67,7 +67,7 @@ def get_option(name: str) -> dict[str, Any]:
|
||||
return d
|
||||
|
||||
|
||||
def set_option_cache(name: str, cs: ChangeSet) -> SqlChangeSet:
|
||||
def set_option_cache(name: str, cs: ChangeSet) -> DbChangeSet:
|
||||
raw_old = get_option(name)
|
||||
|
||||
old = {}
|
||||
@@ -98,7 +98,7 @@ def set_option_cache(name: str, cs: ChangeSet) -> SqlChangeSet:
|
||||
undo_sql += f"update options set value = '{value}' where key = '{key}';"
|
||||
undo_cs |= { key: value }
|
||||
|
||||
return SqlChangeSet(redo_sql, undo_sql, redo_cs, undo_cs)
|
||||
return DbChangeSet(redo_sql, undo_sql, [redo_cs], [undo_cs])
|
||||
|
||||
|
||||
def set_option(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
|
||||
Reference in New Issue
Block a user