babylon.kernel.database
Kernel protocol for the injectable database connection.
babylon.persistence.database.DatabaseConnection is the SQLAlchemy
implementation; this protocol is the surface the engine’s service container
types against, so SQLAlchemy plumbing lives in the persistence layer and the
engine holds only the contract (Constitution II.6 — “no DB I/O during tick”;
Program 14 Phase 1 removed the concrete import from the engine’s DI).
Structural conformance is pinned by tests/unit/kernel/.
Classes
|
Injectable database connection surface. |
- class babylon.kernel.database.DatabaseProtocol(*args, **kwargs)[source]
Bases:
ProtocolInjectable database connection surface.
session()yields a live session inside a context manager;close()disposes the underlying engine.- __init__(*args, **kwargs)