Support to list snapshot
This commit is contained in:
@@ -162,6 +162,14 @@ def execute_redo(name: str) -> ChangeSet:
|
||||
return ChangeSet.from_list(e)
|
||||
|
||||
|
||||
def list_snapshot(name: str) -> list[tuple[int, str]]:
|
||||
rows = read_all(name, f'select * from operation order by id')
|
||||
result = []
|
||||
for row in rows:
|
||||
result.append((int(row['id']), str(row['tag'])))
|
||||
return result
|
||||
|
||||
|
||||
def have_snapshot(name: str, tag: str) -> bool:
|
||||
return read(name, f"select id from snapshot_operation where tag = '{tag}'") != None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user