Spaces:
Sleeping
Sleeping
Download db_scripts/delete_db.py from Ashad001/kpai-analyst: direct link, hf CLI and curl.
- Browser
- Download file 571 Bytes
-
https://huggingface.co/spaces/Ashad001/kpai-analyst/resolve/main/db_scripts/delete_db.py
- Command line
-
hf download hf://spaces/Ashad001/kpai-analyst/db_scripts/delete_db.py
-
curl -L -o delete_db.py https://huggingface.co/spaces/Ashad001/kpai-analyst/resolve/main/db_scripts/delete_db.py
571 Bytes
| import os | |
| import duckdb | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| con = duckdb.connect(f"md:?motherduck_token={os.getenv('MOTHERDUCK_TOKEN')}") | |
| # Drop all tables | |
| query = ''' | |
| DROP TABLE IF EXISTS FEEDBACK; | |
| ''' | |
| con.execute(query) | |
| query = ''' | |
| DROP TABLE IF EXISTS AGENT_RESPONSES; | |
| ''' | |
| con.execute(query) | |
| query = ''' | |
| DROP TABLE IF EXISTS RESPONSES; | |
| ''' | |
| con.execute(query) | |
| query = ''' | |
| DROP TABLE IF EXISTS SESSIONS; | |
| ''' | |
| con.execute(query) | |
| query = ''' | |
| DROP TABLE IF EXISTS USERS; | |
| ''' | |
| con.execute(query) | |
| con.close() | |
| print("Database cleared") | |