Spaces:
Paused

dushyantsingh0 commited on
Commit
35400d1
·
1 Parent(s): 1bcbd77

backend stabilization

Browse files
.gemini/antigravity/brain/3323a093-928d-479d-b63e-c32baeae9533/scratch/check_insights.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import asyncio
2
+ import sys
3
+ import os
4
+
5
+ # Ensure the project root is in path
6
+ sys.path.append(os.getcwd())
7
+
8
+ from core.database import async_session_factory
9
+ from models.knowledge_insight import KnowledgeInsight
10
+ from sqlalchemy import select
11
+
12
+ async def check():
13
+ async with async_session_factory() as db:
14
+ res = await db.execute(select(KnowledgeInsight))
15
+ insights = res.scalars().all()
16
+ print(f"Total Knowledge Insights: {len(insights)}")
17
+ for i in insights:
18
+ print(f"- ID: {i.id}, Title: {i.suggested_title}, Status: {i.status}")
19
+
20
+ if __name__ == "__main__":
21
+ if sys.platform == 'win32':
22
+ asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
23
+ asyncio.run(check())
.gemini/antigravity/brain/3323a093-928d-479d-b63e-c32baeae9533/scratch/check_insights_ws.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import asyncio
2
+ import sys
3
+ import os
4
+
5
+ # Ensure the project root is in path
6
+ sys.path.append(os.getcwd())
7
+
8
+ from core.database import async_session_factory
9
+ from models.knowledge_insight import KnowledgeInsight
10
+ from sqlalchemy import select
11
+
12
+ async def check():
13
+ async with async_session_factory() as db:
14
+ res = await db.execute(select(KnowledgeInsight))
15
+ insights = res.scalars().all()
16
+ print(f"Total Knowledge Insights: {len(insights)}")
17
+ for i in insights:
18
+ print(f"- ID: {i.id}, WS_ID: {i.workspace_id}, Status: {i.status}")
19
+
20
+ if __name__ == "__main__":
21
+ if sys.platform == 'win32':
22
+ asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
23
+ asyncio.run(check())
scratch/check_users_ws.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import asyncio
2
+ import sys
3
+ import os
4
+
5
+ # Ensure the project root is in path
6
+ sys.path.append(os.getcwd())
7
+
8
+ from core.database import async_session_factory
9
+ from models.user import User
10
+ from sqlalchemy import select
11
+
12
+ async def check():
13
+ async with async_session_factory() as db:
14
+ res = await db.execute(select(User))
15
+ users = res.scalars().all()
16
+ print(f"Total Users: {len(users)}")
17
+ for u in users:
18
+ print(f"- Email: {u.email}, WS_ID: {u.workspace_id}, Role: {u.role}")
19
+
20
+ if __name__ == "__main__":
21
+ if sys.platform == 'win32':
22
+ asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
23
+ asyncio.run(check())