Dbc#92
Conversation
YaronZaki
left a comment
There was a problem hiding this comment.
Thanks for tackling #75 — the composition-based approach is the right direction. CI is currently failing on the and jobs though, so we can't merge yet. Could you rebase on main and investigate? The refactor likely broke some existing imports / fixtures that depend on the old inheritance shape.
|
Hi @Lynndabel 👋 Nice refactor moving from inheritance to composition — composition over inheritance is the right call for the db layer, and consolidating engine instantiations is a real win. Unfortunately the branch has merge conflicts against the current main now. Could you rebase onto the latest main and update the PR? The approach looks great and we should be able to merge right after. Thanks for tackling #75! 💪 |
I have completed the refactoring of the database connector hierarchy to resolve a fragile "diamond" inheritance pattern and eliminate redundant SQLAlchemy engine instantiations. The system now uses a composition-based architecture with dependency injection.
Changes Made
Core Database Configuration
[MODIFY]
base.py
Updated DBConnector.init to accept an optional engine. If no engine is provided, it defaults to creating a new one (maintaining backward compatibility where needed), but it now enables sharing a single engine across all connectors.
Closes #75