base#
Application ORM configuration.
- class litestar.contrib.sqlalchemy.base.AuditColumns#
Bases:
object
Created/Updated At Fields Mixin.
- class litestar.contrib.sqlalchemy.base.BigIntAuditBase#
Bases:
CommonTableAttributes
,BigIntPrimaryKey
,AuditColumns
,DeclarativeBase
Base 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.MetaData
collection that will be used for new_schema.Table
objects.See also
- registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>#
Refers to the
_orm.registry
in use where new_orm.Mapper
objects will be associated.
- class litestar.contrib.sqlalchemy.base.BigIntBase#
Bases:
BigIntPrimaryKey
,CommonTableAttributes
,DeclarativeBase
Base 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.MetaData
collection that will be used for new_schema.Table
objects.See also
- registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>#
Refers to the
_orm.registry
in use where new_orm.Mapper
objects will be associated.
- class litestar.contrib.sqlalchemy.base.BigIntPrimaryKey#
Bases:
object
BigInt Primary Key Field Mixin.
- id#
BigInt Primary key column.
- class litestar.contrib.sqlalchemy.base.CommonTableAttributes#
Bases:
BasicAttributes
Common attributes for SQLALchemy tables.
- litestar.contrib.sqlalchemy.base.create_registry(custom_annotation_map: dict[Any, type[TypeEngine[Any]] | TypeEngine[Any]] | None = None) registry #
Create a new SQLAlchemy registry.
- class litestar.contrib.sqlalchemy.base.ModelProtocol#
Bases:
Protocol
The 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_flush
event to bump theupdated
timestamp on modified instances.
- class litestar.contrib.sqlalchemy.base.UUIDAuditBase#
Bases:
CommonTableAttributes
,UUIDPrimaryKey
,AuditColumns
,DeclarativeBase
Base for declarative models with UUID primary keys and audit columns.
- registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>#
Refers to the
_orm.registry
in use where new_orm.Mapper
objects 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.MetaData
collection that will be used for new_schema.Table
objects.See also
- class litestar.contrib.sqlalchemy.base.UUIDBase#
Bases:
UUIDPrimaryKey
,CommonTableAttributes
,DeclarativeBase
Base for all SQLAlchemy declarative models with UUID primary keys.
- registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>#
Refers to the
_orm.registry
in use where new_orm.Mapper
objects 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.MetaData
collection that will be used for new_schema.Table
objects.See also