Release: 1.4.30 | Release Date: January 19, 2022

SQLAlchemy 1.4 Documentation

SQLAlchemy 1.4 Documentation

Contents | Index

SQLAlchemy ORM

  • Object Relational Tutorial (1.x API)
  • Mapper Configuration
    • Mapping Python Classes
    • Mapping Classes with Declarative¶
      • Table Configuration with Declarative
      • Mapper Configuration with Declarative
      • Composing Mapped Hierarchies with Mixins
    • Mapping Columns and Expressions
    • Mapping Class Inheritance Hierarchies
    • Non-Traditional Mappings
    • Configuring a Version Counter
    • Class Mapping API
  • Relationship Configuration
  • Querying Data, Loading Objects
  • Using the Session
  • Events and Internals
  • ORM Extensions
  • ORM Examples

Mapping Classes with Declarative¶

The Declarative mapping style is the primary style of mapping that is used with SQLAlchemy. See the section Declarative Mapping for the top level introduction.

  • Table Configuration with Declarative
    • Declarative Table
      • Accessing Table and Metadata
      • Declarative Table Configuration
      • Explicit Schema Name with Declarative Table
      • Adding New Columns
    • Declarative with Imperative Table (a.k.a. Hybrid Declarative)
    • Mapping Declaratively with Reflected Tables
      • Using DeferredReflection
      • Using Automap
  • Mapper Configuration with Declarative
    • Defining Mapped Properties with Declarative
    • Mapper Configuration Options with Declarative
    • Other Declarative Mapping Directives
      • __declare_last__()
      • __declare_first__()
      • metadata
      • __abstract__
      • __table_cls__
  • Composing Mapped Hierarchies with Mixins
    • Augmenting the Base
    • Mixing in Columns
    • Mixing in Relationships
      • Using Advanced Relationship Arguments (e.g. primaryjoin, etc.)
    • Mixing in deferred(), column_property(), and other MapperProperty classes
    • Mixing in Association Proxy and Other Attributes
    • Controlling table inheritance with mixins
    • Mixing in Columns in Inheritance Scenarios
    • Combining Table/Mapper Arguments from Multiple Mixins
    • Creating Indexes with Mixins
Previous: Mapping Python Classes Next: Table Configuration with Declarative
© Copyright 2007-2022, the SQLAlchemy authors and contributors.

flambé! the dragon and The Alchemist image designs created and generously donated by Rotem Yaari.

Created using Sphinx 4.4.0.