You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add relationship() with back_populates for SQLAlchemy models (issue #47) (#77)
* Add relationship() with back_populates for SQLAlchemy models (issue #47)
- Add new `relationships` parameter to `create_models()` function
- Generate bidirectional relationships with `back_populates` for foreign keys
- Support both `sqlalchemy` and `sqlalchemy_v2` model types:
- For sqlalchemy: uses `relationship("Model", back_populates="attr")`
- For sqlalchemy_v2: uses `Mapped[List["Model"]]` and `Mapped["Model"]` type hints
- Add `collect_relationships()` function to gather FK relationships from tables
- Handle both inline FK references and ALTER TABLE FK definitions
- Add functional and integration tests for both model types
- Update CHANGELOG with new feature documentation
* Fix flake8 errors: remove unused imports and reduce complexity
0 commit comments