Skip to content

Dbc#92

Open
Lynndabel wants to merge 10 commits into
Quantarq:mainfrom
Lynndabel:dbc
Open

Dbc#92
Lynndabel wants to merge 10 commits into
Quantarq:mainfrom
Lynndabel:dbc

Conversation

@Lynndabel

Copy link
Copy Markdown

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

@YaronZaki YaronZaki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

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! 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: Refactor PositionDBConnector deep inheritance to composition

2 participants