babylon.data.database
Database configuration and session management.
Provides SQLAlchemy engine and session configuration for the application. Uses SQLite for local persistence - simple, embedded, no server required.
Functions
|
Get a database session. |
Classes
|
Base class for all SQLAlchemy models. |
- class babylon.data.database.Base(**kwargs)[source]
Bases:
DeclarativeBaseBase class for all SQLAlchemy models.
- Parameters:
kwargs (Any)
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- metadata: ClassVar[MetaData] = MetaData()
Refers to the
_schema.MetaDatacollection that will be used for new_schema.Tableobjects.See also
orm_declarative_metadata
- registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>
Refers to the
_orm.registryin use where new_orm.Mapperobjects will be associated.