This is a small educational project demonstrating:
- How to use a context manager for resource management (database connection).
- How to use a decorator to log query execution time.
- Clean and reusable code
- Simulates connecting to and disconnecting from a database
- Logs query execution time
No external dependencies. Works with Python 3.x.
python main.py
## Example Output
Connecting to database...
Executing query: fetch_users
Fetching users from DB Connection Object
Query executed in 2.0005 seconds
['User1', 'User2', 'User3']
Closing database connection...