Skip to content

Latest commit

 

History

History
94 lines (55 loc) · 5.8 KB

File metadata and controls

94 lines (55 loc) · 5.8 KB
graph LR
    CRUDService["CRUDService"]
    QueryBuilder["QueryBuilder"]
    DatabaseSessionManager["DatabaseSessionManager"]
    ORMModel["ORMModel"]
    PydanticSchema["PydanticSchema"]
    Database["Database"]
    Unclassified["Unclassified"]
    CRUDService -- "uses" --> PydanticSchema
    CRUDService -- "delegates to" --> QueryBuilder
    QueryBuilder -- "inspects" --> ORMModel
    CRUDService -- "requests session from" --> DatabaseSessionManager
    DatabaseSessionManager -- "manages connection to" --> Database
    CRUDService -- "manipulates" --> ORMModel
    click ORMModel href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/sqlalchemy-crud-plus/ORMModel.md" "Details"
Loading

CodeBoardingDemoContact

Details

The sqlalchemy_crud_plus project provides a streamlined approach to database interactions by centralizing CRUD operations within the CRUDService. This service acts as the primary interface, receiving data often validated by PydanticSchema and translating requests into database operations. It intelligently delegates complex query construction to the QueryBuilder, which dynamically builds SQLAlchemy expressions by inspecting ORMModel definitions. All database interactions are facilitated through DatabaseSessionManager, ensuring proper session and transaction handling with the underlying Database. This modular design promotes a clear separation of concerns, making the system easy to understand, extend, and maintain, while providing a robust foundation for data management.

CRUDService

The central component responsible for executing all Create, Read, Update, and Delete operations on ORM models, acting as the primary interface for database interactions.

Related Classes/Methods:

QueryBuilder

Constructs dynamic SQLAlchemy query components, including filter expressions (AND, OR, arithmetic) and sorting clauses, by translating high-level specifications into database-executable expressions.

Related Classes/Methods:

DatabaseSessionManager

Provides and manages the SQLAlchemy AsyncSession instance, ensuring proper transaction scope and connection handling for all database operations.

Related Classes/Methods:

ORMModel [Expand]

Represents the user-defined SQLAlchemy declarative models, defining the database schema, data structure, and providing essential metadata for database operations.

Related Classes/Methods:

PydanticSchema

An external component (Pydantic) used for validating incoming data before processing by CRUD operations and for serializing outgoing ORM model instances into a desired format.

Related Classes/Methods:

Database

The actual persistent data store (e.g., PostgreSQL, SQLite) where application data is stored and retrieved.

Related Classes/Methods:

Unclassified

Component for all unclassified files and utility functions (Utility functions/External Libraries/Dependencies)

Related Classes/Methods: None