Spaces:
Sleeping
Sleeping
Download db_scripts/check_db.py from Ashad001/kpai-analyst: direct link, hf CLI and curl.
- Browser
- Download file 395 Bytes
-
https://huggingface.co/spaces/Ashad001/kpai-analyst/resolve/main/db_scripts/check_db.py
- Command line
-
hf download hf://spaces/Ashad001/kpai-analyst/db_scripts/check_db.py
-
curl -L -o check_db.py https://huggingface.co/spaces/Ashad001/kpai-analyst/resolve/main/db_scripts/check_db.py
395 Bytes
| # read db content | |
| import os | |
| import duckdb | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| conn = duckdb.connect(f"md:?motherduck_token={os.getenv('MOTHERDUCK_TOKEN')}") | |
| user_query = """ | |
| SELECT * FROM USERS | |
| """ | |
| result = conn.execute(user_query).fetchdf() | |
| print(result) | |
| session_query = """ | |
| SELECT * FROM SESSIONS | |
| """ | |
| result = conn.execute(session_query).fetchdf() | |
| print(result) | |
| conn.close() |