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
  • Relationship Configuration
  • Loading Objects
  • Using the Session¶
    • Session Basics
    • State Management
    • Cascades
    • Transactions and Connection Management
    • Additional Persistence Techniques
    • Contextual/Thread-local Sessions
    • Tracking Object and Session Changes with Events
    • Session API
  • Events and Internals
  • ORM Extensions
  • ORM Examples

Home

  • Previous: Query API
  • Next: Session Basics
  • Up: Home
    • SQLAlchemy ORM
  • On this page:
    • Using the Session

Using the Session¶

The mapper() function and declarative extensions are the primary configurational interface for the ORM. Once mappings are configured, the primary usage interface for persistence operations is the Session.

  • Session Basics
    • What does the Session do ?
    • Getting a Session
    • Session Frequently Asked Questions
    • Basics of Using a Session
  • State Management
    • Quickie Intro to Object States
    • Session Attributes
    • Session Referencing Behavior
    • Merging
    • Expunging
    • Refreshing / Expiring
  • Cascades
    • save-update
    • delete
    • delete-orphan
    • merge
    • refresh-expire
    • expunge
    • Controlling Cascade on Backrefs
  • Transactions and Connection Management
    • Managing Transactions
    • Joining a Session into an External Transaction (such as for test suites)
  • Additional Persistence Techniques
    • Embedding SQL Insert/Update Expressions into a Flush
    • Using SQL Expressions with Sessions
    • Forcing NULL on a column with a default
    • Fetching Server-Generated Defaults
    • Partitioning Strategies (e.g. multiple database backends per Session)
    • Bulk Operations
  • Contextual/Thread-local Sessions
    • Implicit Method Access
    • Thread-Local Scope
    • Using Thread-Local Scope with Web Applications
    • Using Custom Created Scopes
    • Contextual Session API
  • Tracking Object and Session Changes with Events
    • Persistence Events
    • Object Lifecycle Events
    • Transaction Events
    • Attribute Change Events
  • Session API
    • Session and sessionmaker()
    • Session Utilities
    • Attribute and State Management Utilities
Previous: Query API Next: Session Basics
© 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