refactor: update migration paths and improve database operation handling
This commit is contained in:
@@ -36,6 +36,10 @@ class _FakeSession:
|
||||
committed: int = 0
|
||||
|
||||
async def exec(self, _statement: Any) -> Any:
|
||||
is_dml = _statement.__class__.__name__ in {"Delete", "Update", "Insert"}
|
||||
if is_dml:
|
||||
self.executed.append(_statement)
|
||||
return None
|
||||
if not self.exec_results:
|
||||
raise AssertionError("No more exec_results left for session.exec")
|
||||
return self.exec_results.pop(0)
|
||||
|
||||
Reference in New Issue
Block a user