base#
Application ORM configuration.
- class litestar.contrib.sqlalchemy.base.AuditColumns#
Bases:
objectCreated/Updated At Fields Mixin.
- class litestar.contrib.sqlalchemy.base.BigIntAuditBase#
Bases:
CommonTableAttributes,BigIntPrimaryKey,AuditColumns,DeclarativeBaseBase for declarative models with BigInt primary keys and audit columns.
- __init__(**kwargs: Any) None#
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
- registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>#
Refers to the
_orm.registryin use where new_orm.Mapperobjects will be associated.
- class litestar.contrib.sqlalchemy.base.BigIntBase#
Bases:
BigIntPrimaryKey,CommonTableAttributes,DeclarativeBaseBase for all SQLAlchemy declarative models with BigInt primary keys.
- __init__(**kwargs: Any) None#
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
- registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>#
Refers to the
_orm.registryin use where new_orm.Mapperobjects will be associated.
- class litestar.contrib.sqlalchemy.base.BigIntPrimaryKey#
Bases:
objectBigInt Primary Key Field Mixin.
- id#
BigInt Primary key column.
- class litestar.contrib.sqlalchemy.base.CommonTableAttributes#
Bases:
objectCommon attributes for SQLALchemy tables.
- litestar.contrib.sqlalchemy.base.create_registry(custom_annotation_map: dict[type, type[TypeEngine[Any]] | TypeEngine[Any]] | None = None) registry#
Create a new SQLAlchemy registry.
- class litestar.contrib.sqlalchemy.base.ModelProtocol#
Bases:
ProtocolThe base SQLAlchemy model protocol.
- __init__(*args, **kwargs)#
- litestar.contrib.sqlalchemy.base.touch_updated_timestamp(session: Session, *_: Any) None#
Set timestamp on update.
Called from SQLAlchemy’s
before_flushevent to bump theupdatedtimestamp on modified instances.
- class litestar.contrib.sqlalchemy.base.UUIDAuditBase#
Bases:
CommonTableAttributes,UUIDPrimaryKey,AuditColumns,DeclarativeBaseBase for declarative models with UUID primary keys and audit columns.
- registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>#
Refers to the
_orm.registryin use where new_orm.Mapperobjects will be associated.
- __init__(**kwargs: Any) None#
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
- class litestar.contrib.sqlalchemy.base.UUIDBase#
Bases:
UUIDPrimaryKey,CommonTableAttributes,DeclarativeBaseBase for all SQLAlchemy declarative models with UUID primary keys.
- registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>#
Refers to the
_orm.registryin use where new_orm.Mapperobjects will be associated.
- __init__(**kwargs: Any) None#
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