Spaces:
Runtime error
Runtime error
Download scripts/drop_functions.py from cuatrolabs/cuatrolabs-scm-ms: direct link, hf CLI and curl.
- Browser
- Download file 620 Bytes
-
https://huggingface.co/spaces/cuatrolabs/cuatrolabs-scm-ms/resolve/main/scripts/drop_functions.py
- Command line
-
hf download hf://spaces/cuatrolabs/cuatrolabs-scm-ms/scripts/drop_functions.py
-
curl -L -o drop_functions.py https://huggingface.co/spaces/cuatrolabs/cuatrolabs-scm-ms/resolve/main/scripts/drop_functions.py
620 Bytes
| import asyncio | |
| from app.sql import connect_to_database, async_session | |
| from sqlalchemy import text | |
| async def drop_functions(): | |
| await connect_to_database() | |
| async with async_session() as session: | |
| print("Dropping functions...") | |
| await session.execute(text("DROP FUNCTION IF EXISTS trans.fn_get_po_items_for_purchase_return(uuid, character varying);")) | |
| await session.execute(text("DROP FUNCTION IF EXISTS trans.fn_get_po_items_for_purchase_return(uuid, uuid);")) | |
| await session.commit() | |
| print("Functions dropped.") | |
| if __name__ == "__main__": | |
| asyncio.run(drop_functions()) | |