graph LR
SAConnection["SAConnection"]
_execute["_execute"]
_executemany["_executemany"]
_acquire["_acquire"]
_begin_impl["_begin_impl"]
_base_params["_base_params"]
close["close"]
__aexit__["__aexit__"]
_acquire -- "provides instances of" --> SAConnection
SAConnection -- "delegates single query execution to" --> _execute
SAConnection -- "delegates batch query execution to" --> _executemany
SAConnection -- "initiates transactions via" --> _begin_impl
SAConnection -- "relies on" --> close
_execute -- "utilizes" --> _base_params
_execute -- "can delegate batch operations to" --> _executemany
__aexit__ -- "ensures call to" --> close
The SQLAlchemy Connection Adapter subsystem in aiomysql
The core adapter class that provides a SQLAlchemy-compliant asynchronous connection interface. It manages SQL query execution, transaction management, and resource cleanup, acting as the primary interface for SQLAlchemy operations.
Related Classes/Methods:
Responsible for asynchronously executing a single SQL statement. It handles parameter processing and can delegate to batch execution when multiple parameters are provided for a single statement.
Related Classes/Methods:
Optimizes the execution of multiple SQL statements or a single statement with multiple parameter sets. This component is crucial for performance in batch operations, such as bulk inserts or updates.
Related Classes/Methods:
Manages the acquisition of SAConnection instances, typically from a connection pool. This ensures efficient reuse and management of database connections.
Related Classes/Methods:
Implements the asynchronous logic for initiating a database transaction. This ensures that a series of database operations are treated as a single, atomic unit.
Related Classes/Methods:
Processes and validates SQL parameters before execution. This component ensures data integrity and helps prevent common issues like SQL injection by properly formatting and escaping parameters.
Related Classes/Methods:
Asynchronously terminates the underlying database connection. This releases associated resources back to the connection pool or the operating system, preventing resource leaks.
Related Classes/Methods:
Provides asynchronous context management for SAConnection instances. It ensures that the close method is automatically called upon exiting an async with block, guaranteeing resource cleanup even in the presence of exceptions.
Related Classes/Methods: