This commit is contained in:
Timothy Jaeryang Baek committed 2026-06-17 00:25:35 +02:00
1 parent 6b2d962cd6
commit 232421f40b
3 files changed
+36 -1

No files matched your search

+15
View File
@@ -1571,6 +1571,21 @@ class ChatTable:
log.info(f"Count of chats for folder '{folder_id}': {count}")
return count
async def count_chats_by_folder_ids_and_user_id(
self, folder_ids: list[str], user_id: str, db: AsyncSession | None = None
) -> int:
if not folder_ids:
return 0
async with get_async_db_context(db) as session:
result = await session.execute(
select(func.count(Chat.id)).filter(Chat.user_id == user_id, Chat.folder_id.in_(folder_ids))
)
count = result.scalar()
log.info(f"Count of chats for folders '{folder_ids}': {count}")
return count
async def delete_tag_by_id_and_user_id_and_tag_name(
self, id: str, user_id: str, tag_name: str, db: AsyncSession | None = None
) -> bool: