This commit is contained in:
Timothy Jaeryang Baek committed 2026-06-20 18:06:00 +02:00
1 parent 0fddcba26d
commit 07e7b7623b
13 files changed
+592 -209

No files matched your search

+15
View File
@@ -97,6 +97,21 @@ class Workspace(Base):
await db.commit()
return result.rowcount > 0
@staticmethod
async def delete_by_paths(user_id: str, paths: list[str]) -> int:
"""Delete workspaces by path. Returns the number of deleted rows."""
if not paths:
return 0
async with await get_db() as db:
result = await db.execute(
delete(Workspace).where(
Workspace.user_id == user_id,
Workspace.path.in_(paths),
)
)
await db.commit()
return result.rowcount or 0
@staticmethod
async def delete_by_user(user_id: str) -> None:
"""Delete all workspaces for a user."""