Release: 1.3.24 | Release Date: March 30, 2021

SQLAlchemy 1.3 Documentation

SQLAlchemy 1.3 Documentation

Home

SQLAlchemy ORM

  • Object Relational Tutorial
  • Mapper Configuration
    • Types of Mappings
    • 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
  • Loading Objects
  • Using the Session
  • Events and Internals
  • ORM Extensions
  • ORM Examples

Home

  • Previous: Types of Mappings
  • 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
    • 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
    • composite()
    • Tracking In-Place Mutations on Composites
    • Redefining Comparison Operations for Composites
    • Nesting Composites
Previous: Types of Mappings Next: Mapping Table Columns
© Copyright 2007-2021, the SQLAlchemy authors and contributors.

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

Created using Sphinx 7.2.6. Documentation last generated: Tue 19 Dec 2023 07:05:39 PM