Release: 1.4.54
legacy version
| Release Date: September 5, 2024
SQLAlchemy 1.4 Documentation
- Previous: Query API
- Next: Session Basics
- Up: Home
- On this page:
Using the Session¶
The declarative base and ORM mapping functions described at
ORM Mapped Class Configuration 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 ?
- Basics of Using a Session
- Opening and Closing a Session
- Framing out a begin / commit / rollback block
- Using a sessionmaker
- Querying (1.x Style)
- Querying (2.0 style)
- Adding New or Existing Items
- Deleting
- Flushing
- Get by Primary Key
- Expiring / Refreshing
- UPDATE and DELETE with arbitrary WHERE clause
- Auto Begin
- Committing
- Rolling Back
- Closing
- Session Frequently Asked Questions
- State Management
- Cascades
- Transactions and Connection Management
- 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
- Case 1: non primary key, RETURNING or equivalent is supported
- Case 2: non primary key, RETURNING or equivalent is not supported or not needed
- Case 3: primary key, RETURNING or equivalent is supported
- Case 4: primary key, RETURNING or equivalent is not supported
- Notes on eagerly fetching client invoked SQL expressions used for INSERT or UPDATE
- Using INSERT, UPDATE and ON CONFLICT (i.e. upsert) to return ORM Objects
- Partitioning Strategies (e.g. multiple database backends per Session)
- Bulk Operations
- Contextual/Thread-local Sessions
- Tracking queries, object and Session Changes with Events
- Session API
Previous:
Query API
Next:
Session Basics
© Copyright 2007-2024, 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: Wed 30 Oct 2024 02:18:58 PM EDT