[kimi] Add ConnectionPool class with unit tests (#769) #830
Reference in New Issue
Block a user
Delete Branch "kimi/issue-769"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #769
Summary
Added the
ConnectionPoolclass tosrc/infrastructure/db_pool.pywith comprehensive unit tests intests/infrastructure/test_db_pool.py.Changes
New Files
src/infrastructure/db_pool.py- Thread-local SQLite connection pooltests/infrastructure/test_db_pool.py- Unit testsModified Files
.gitignore- Removedsrc/infrastructure/db_pool.pyfrom ignored filesFeatures
The
ConnectionPoolclass provides:get_connection()- Returns a valid sqlite3 connection (creates DB if needed)close_connection()- Cleans up thread-local storageconnection()context manager - Yields and closes properlyTests
24 test cases covering:
All tests pass with tox -e unit.