Spaces:
Runtime error
Runtime error
Download check_enum.py from Antaram/pratikbackend: direct link, hf CLI and curl.
- Browser
- Download file 451 Bytes
-
https://huggingface.co/spaces/Antaram/pratikbackend/resolve/main/check_enum.py
- Command line
-
hf download hf://spaces/Antaram/pratikbackend/check_enum.py
-
curl -L -o check_enum.py https://huggingface.co/spaces/Antaram/pratikbackend/resolve/main/check_enum.py
451 Bytes
| import asyncio | |
| from sqlalchemy import text | |
| from app.core.database import engine | |
| async def check_enum(): | |
| async with engine.connect() as conn: | |
| result = await conn.execute(text(""" | |
| SELECT enumlabel FROM pg_enum | |
| WHERE enumtypid = (SELECT oid FROM pg_type WHERE typname = 'partytype') | |
| """)) | |
| labels = [row[0] for row in result] | |
| print(f'Current enum values: {labels}') | |
| asyncio.run(check_enum()) | |