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
registry
add_mapped_attribute()
column_property()
declarative_base()
declarative_mixin()
as_declarative()
mapped_column()
declared_attr
DeclarativeBase
DeclarativeBaseNoMeta
has_inherited_table()
synonym_for()
object_mapper()
class_mapper()
configure_mappers()
clear_mappers()
identity_key()
polymorphic_union()
orm_insert_sentinel()
reconstructor()
Mapper
Mapper.__init__()
Mapper.add_properties()
Mapper.add_property()
Mapper.all_orm_descriptors
Mapper.attrs
Mapper.base_mapper
Mapper.c
Mapper.cascade_iterator()
Mapper.class_
Mapper.class_manager
Mapper.column_attrs
Mapper.columns
Mapper.common_parent()
Mapper.composites
Mapper.concrete
Mapper.configured
Mapper.entity
Mapper.get_property()
Mapper.get_property_by_column()
Mapper.identity_key_from_instance()
Mapper.identity_key_from_primary_key()
Mapper.identity_key_from_row()
Mapper.inherits
Mapper.is_mapper
Mapper.is_sibling()
Mapper.isa()
Mapper.iterate_properties
Mapper.local_table
Mapper.mapper
Mapper.persist_selectable
Mapper.polymorphic_identity
Mapper.polymorphic_iterator()
Mapper.polymorphic_map
Mapper.polymorphic_on
Mapper.primary_key
Mapper.primary_key_from_instance()
Mapper.primary_mapper()
Mapper.relationships
Mapper.selectable
Mapper.self_and_descendants
Mapper.single
Mapper.synonyms
Mapper.tables
Mapper.validators
Mapper.with_polymorphic_mappers
MappedAsDataclass
MappedClassProtocol