Skip to content

backend

Bundle of everything a database connection needs for native execution.

NativeBackend dataclass

What a DatabaseConnection needs to run statements natively, created once on connect() when the driver has an adapter: the dialect, the driver adapter that runs statements, and the compiler whose plan cache is shared by all queries on that database.

Source code in ormar/databases/native/backend.py
Python
13
14
15
16
17
18
19
20
21
22
23
24
@dataclass
class NativeBackend:
    """
    What a ``DatabaseConnection`` needs to run statements natively, created
    once on ``connect()`` when the driver has an adapter: the dialect, the
    driver adapter that runs statements, and the compiler whose plan cache is
    shared by all queries on that database.
    """

    dialect: Dialect
    adapter: DriverAdapter
    compiler: NativeCompiler