-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Your task is to create a Database Connection Module. This means you need to create Python code that will handle all connections to the TimescaleDB instance.
Files Needed
- db_connection.py
- Usage example file or documented examples in comments
Specifications
Functions include:
- get_connection() - establish single database connection
- get_connection_pool() - setup connection pooling (optional but recommended)
- close_connection(conn) - properly close connection
- test_connection() - verify database is accessible
Additional requirements:
- Handle connection errors gracefully with clear error messages
- Use environment variables or config file for credentials (host, port, database, user, password)
- Implement context managers for clean resource handling
Connection details:
- Host: localhost
- Port: 5432
- Database: daq_data
- User: fsae
Deliverable
Submit working connection functions with usage examples. Test using the verification command from the setup guide and ensure connections work properly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels