ORM 映射类配置¶
ORM Mapped Class Configuration
详细的 ORM 配置参考,不包括关系配置,关系配置详见 关系配置。
要快速了解典型的 ORM 配置,请从 ORM 快速入门 开始。
关于在 SQLAlchemy 中实现的对象关系映射概念的介绍,首先在 SQLAlchemy 统一教程 的 使用 ORM 声明形式定义表元数据 中介绍。
Detailed reference for ORM configuration, not including relationships, which are detailed at 关系配置.
For a quick look at a typical ORM configuration, start with ORM 快速入门.
For an introduction to the concept of object relational mapping as implemented in SQLAlchemy, it’s first introduced in the SQLAlchemy 统一教程 at 使用 ORM 声明形式定义表元数据.
- ORM 映射类概述
- 使用声明式映射类
- 与dataclass和attrs的集成
- SQL 表达式作为映射属性
- 更改Attribute的行为
- 复合列类型
- 映射类继承层次结构
- 非传统映射
- 配置版本计数器
- 类映射 API
registryadd_mapped_attribute()column_property()declarative_base()declarative_mixin()as_declarative()mapped_column()declared_attrDeclarativeBaseDeclarativeBaseNoMetahas_inherited_table()synonym_for()object_mapper()class_mapper()configure_mappers()clear_mappers()identity_key()polymorphic_union()orm_insert_sentinel()reconstructor()MapperMapper.__init__()Mapper.add_properties()Mapper.add_property()Mapper.all_orm_descriptorsMapper.attrsMapper.base_mapperMapper.cMapper.cascade_iterator()Mapper.class_Mapper.class_managerMapper.column_attrsMapper.columnsMapper.common_parent()Mapper.compositesMapper.concreteMapper.configuredMapper.entityMapper.get_property()Mapper.get_property_by_column()Mapper.identity_key_from_instance()Mapper.identity_key_from_primary_key()Mapper.identity_key_from_row()Mapper.inheritsMapper.is_mapperMapper.is_sibling()Mapper.isa()Mapper.iterate_propertiesMapper.local_tableMapper.mapperMapper.persist_selectableMapper.polymorphic_identityMapper.polymorphic_iterator()Mapper.polymorphic_mapMapper.polymorphic_onMapper.primary_keyMapper.primary_key_from_instance()Mapper.primary_mapper()Mapper.relationshipsMapper.selectableMapper.self_and_descendantsMapper.singleMapper.synonymsMapper.tablesMapper.validatorsMapper.with_polymorphic_mappers
MappedAsDataclassMappedClassProtocol