Download BackEnd/controllers/test_controllers.py from Jennigwen/isitfake: direct link, hf CLI and curl.
- Browser
- Download file 613 Bytes
-
https://huggingface.co/Jennigwen/isitfake/resolve/main/BackEnd/controllers/test_controllers.py
- Command line
-
hf download hf://Jennigwen/isitfake/BackEnd/controllers/test_controllers.py
-
curl -L -o test_controllers.py https://huggingface.co/Jennigwen/isitfake/resolve/main/BackEnd/controllers/test_controllers.py
613 Bytes
| from core.db_connector import get_db | |
| from core.response_json import success_response, server_error_response | |
| def test_connection(): | |
| try: | |
| db = get_db() | |
| response = db.table("users").select("id").limit(1).execute() | |
| return success_response( | |
| message="Database connection successful!", | |
| data={ | |
| "connection": "OK", | |
| "test_query_data": response.data # Akan mengembalikan [] jika tabel masih kosong | |
| }, | |
| status_code=200 | |
| ) | |
| except Exception as e: | |
| return server_error_response(error_details=str(e)) |