Bappadala Rohith Kumar Naidu
feat: complete enterprise-grade dataset sync of RAG, offline bundles, and pipeline scripts
92cf271
Raw
History Blame Contribute Delete
838 Bytes
import asyncio
import os
from dotenv import load_dotenv
import asyncpg
load_dotenv()
async def check():
url = os.environ['DATABASE_URL'].replace('postgresql+asyncpg://', 'postgresql://')
conn = await asyncpg.connect(url)
# Check tables
tables = await conn.fetch(
"SELECT tablename FROM pg_tables WHERE schemaname='public' ORDER BY tablename"
)
print('Tables in Supabase:')
for t in tables:
print(' -', t['tablename'])
# Check row counts
for table in ['emergency_services', 'road_infrastructure', 'road_issues']:
try:
count = await conn.fetchval(f"SELECT COUNT(*) FROM {table}")
print(f' {table}: {count} rows')
except Exception as e:
print(f' {table}: NOT FOUND - {e}')
await conn.close()
asyncio.run(check())