Release: 1.4.34 | Release Date: March 31, 2022

SQLAlchemy 1.4 Documentation

SQLAlchemy 1.4 Documentation

Home

SQLAlchemy ORM

  • ORM Quick Start
  • Object Relational Tutorial (1.x API)
  • Mapper Configuration
    • Mapping Python Classes
    • Mapping Classes with Declarative
    • Mapping Columns and Expressions¶
      • Mapping Table Columns
      • SQL Expressions as Mapped Attributes
      • Changing Attribute Behavior
      • Composite Column Types
    • 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

Home

  • Previous: Composing Mapped Hierarchies with Mixins
  • Next: Mapping Table Columns
  • Up: Home
    • SQLAlchemy ORM
      • Mapper Configuration
  • On this page:
    • Mapping Columns and Expressions

Mapping Columns and Expressions¶

The following sections discuss how table columns and SQL expressions are mapped to individual object attributes.

  • Mapping Table Columns
    • Naming Columns Distinctly from Attribute Names
    • Automating Column Naming Schemes from Reflected Tables
    • Naming All Columns with a Prefix
    • Using column_property for column level options
    • Mapping a Subset of Table Columns
  • SQL Expressions as Mapped Attributes
    • Using a Hybrid
    • Using column_property
      • Composing from Column Properties at Mapping Time
    • Using a plain descriptor
    • Query-time SQL expressions as mapped attributes
  • Changing Attribute Behavior
    • Simple Validators
    • Using Custom Datatypes at the Core Level
    • Using Descriptors and Hybrids
    • Synonyms
    • Operator Customization
  • Composite Column Types
    • Tracking In-Place Mutations on Composites
    • Redefining Comparison Operations for Composites
    • Nesting Composites
Previous: Composing Mapped Hierarchies with Mixins Next: Mapping Table Columns
© 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.5.0.