-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor SQLAlchemy Repository for Multiple Tables #118
Comments
5 tasks
Merged
perdy
added a commit
that referenced
this issue
Oct 6, 2023
perdy
added a commit
that referenced
this issue
Oct 24, 2023
migduroli
pushed a commit
that referenced
this issue
Sep 3, 2024
github-actions bot
pushed a commit
that referenced
this issue
Sep 3, 2024
# [v1.7.0](v1.6.0...v1.7.0) (2024-09-03) ## ✨ New Features - [`96229a1`](96229a1) Decouple table manager logic from repositories (#118) (Issues: [`#118`](https://github.com/vortico/flama/issues/)) - [`d944180`](d944180) Enhanced OpenAPI docstrings (#121) (Issues: [`#121`](https://github.com/vortico/flama/issues/)) - [`a66d5ee`](a66d5ee) Enhanced actions for DDD repositories (#124) (Issues: [`#124`](https://github.com/vortico/flama/issues/)) - [`0695c77`](0695c77) ASGI Cookies component - [`cd06bdb`](cd06bdb) Python 3.12 compatibility (#119) (Issues: [`#119`](https://github.com/vortico/flama/issues/)) - [`a2ef280`](a2ef280) Single type injection (#126) (Issues: [`#126`](https://github.com/vortico/flama/issues/)) - [`869711d`](869711d) Connections manager for SQLAlchemy module (#135) (Issues: [`#135`](https://github.com/vortico/flama/issues/)) - [`4899473`](4899473) Authentication mechanism (#137) (Issues: [`#137`](https://github.com/vortico/flama/issues/)) - [`03634c2`](03634c2) Ordering for repositories list (#139) (Issues: [`#139`](https://github.com/vortico/flama/issues/)) - [`070fb4f`](070fb4f) Enhanced operations for CRUD (#141) (Issues: [`#141`](https://github.com/vortico/flama/issues/)) - [`bd4f6c1`](bd4f6c1) Non-blocking errors on schema generation - [`4e5ba47`](4e5ba47) Implement DDD for HTTP resources - [`c177eef`](c177eef) Use PartialSchema for all-optional schema version - [`336914e`](336914e) HTTPWorker accepts client kwargs ## 🐛 Bug Fixes - [`518a4eb`](518a4eb) Fix resolution for routes within nested resources - [`3e1c0a8`](3e1c0a8) Include nested applications in Lifespan (#130) (Issues: [`#130`](https://github.com/vortico/flama/issues/)) - [`036264e`](036264e) Resolve url match multiple path params - [`2664aba`](2664aba) Remove unintended sqlalchemy import (#143) (Issues: [`#143`](https://github.com/vortico/flama/issues/)) - [`cde8071`](cde8071) Serve flama logo from its repository (#144) (Issues: [`#144`](https://github.com/vortico/flama/issues/)) - [`9bcd6d7`](9bcd6d7) Accept empty body as a valid input for schema validation - [`c4d0915`](c4d0915) Fix middleware types - [`5716a6f`](5716a6f) Allow nullable nested schemas for Pydantic - [`8836aa7`](8836aa7) Atomic operations on SQLAlchemy connections management
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Our current SQLAlchemy repository module, represented by the
SQLAlchemyRepository
class, is designed to handle operations on a single table and includes standard CRUDLDel methods. However, as our application grows, we find the need to work with multiple tables in a more organized and modular way.Motivation
Modularity: The current design limits our ability to manage multiple tables efficiently. We want to refactor our repository structure to promote better code modularity and separation of concerns.
Code Reusability: To enhance code reusability, we propose creating a new class called
SQLAlchemyTableManager
, responsible for encapsulating the CRUDLD (Create, Retrieve, Update, Delete, List, Drop) methods for a specific table.Improved Testing: By refactoring our repository structure, we can make our tests more granular and specific, which can help in maintaining and expanding our codebase.
Proposed Changes
Introduce a new class,
SQLAlchemyTableManager
, which encapsulates CRUDLDel methods for a specific table.Create a new class,
SQLAlchemyTableRepository
, that inherits fromSQLAlchemyRepository
and usesSQLAlchemyTableManager
to handle operations on a specific table.Update import statements in the codebase to reflect the use of
SQLAlchemyTableRepository
where necessary.Modify tests to work seamlessly with the new repository structure.
Impact
The text was updated successfully, but these errors were encountered: