Spaces:
Sleeping
Sleeping
File size: 538 Bytes
fa1fead | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import asyncio
from vectorstore.pgvector_client import get_pgvector_client
async def nuke():
client = get_pgvector_client()
await client.connect()
try:
async with client._pool.acquire() as conn:
await conn.execute('TRUNCATE TABLE document_chunks CASCADE;')
await conn.execute('TRUNCATE TABLE documents CASCADE;')
print('✅ Database wiped clean!')
except Exception as e: print(f'❌ Error: {e}')
finally: await client.close()
if __name__ == '__main__': asyncio.run(nuke()) |